Category Archives: How to Fix

CONDA error notwritableerror: the current user does not have write permissions

Just after installing anaconda and preparing CONDA create environment, we encountered the following error

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/NAME/.conda/envs/.conda_envs_dir_test
  uid: 1000
  gid: 1000

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1000:1000 /home/NAME/.conda/envs/.conda_envs_dir_test

In general, it's not advisable to use 'sudo conda'.

According to the prompt he gave, the operation failed, so use the following command to change the permissions of CONDA related folder, – R recursively applied to subfolders

sudo chmod 777 -R ~/anaconda3/
sudo chmod 777 -R ~/.conda/

If the problem is solved for the time being, we will not report the above mistakes

Maybe it’s the redundant problem caused by using sudo sh ana… When installing anaconda.

Solve the problem of warning in sourcetree: templates not found / usr / local / git / share / git core / templates

There are several solutions:

1. If the original git used in sorcetree is embedded git, you can try to switch git to git of the system (if Git is installed in the system, you can install it yourself if not)

2. Currently, sourcetree uses git of the system, and upgrades git of the system to the latest version

I’m the second case

The GIT of the current sourcetree can be viewed in the following ways, and the grayed one is the current one

 

java.lang.IllegalStateException: Could not execute method for android:onClick

I didn’t think about it before I heard it..

Error screenshot

error message

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.imoocmusicdemo, PID: 14631
    java.lang.IllegalStateException: Could not execute method for android:onClick
        at android.view.View$DeclaredOnClickListener.onClick(View.java:5634)
        at android.view.View.performClick(View.java:6597)
        at android.view.View.performClickInternal(View.java:6574)
        at android.view.View.access$3100(View.java:778)
        at android.view.View$PerformClick.run(View.java:25885)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at android.view.View$DeclaredOnClickListener.onClick(View.java:5629)
        at android.view.View.performClick(View.java:6597) 
        at android.view.View.performClickInternal(View.java:6574) 
        at android.view.View.access$3100(View.java:778) 
        at android.view.View$PerformClick.run(View.java:25885) 
        at android.os.Handler.handleCallback(Handler.java:873) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6669) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
     Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.imoocmusicdemo/com.example.imoocmusicdemo.activitys.RegisterActivity}; have you declared this activity in your AndroidManifest.xml?
        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2005)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1673)
        at android.app.Activity.startActivityForResult(Activity.java:4586)
        at android.app.Activity.startActivityForResult(Activity.java:4544)
        at android.app.Activity.startActivity(Activity.java:4905)
        at android.app.Activity.startActivity(Activity.java:4873)
        at com.example.imoocmusicdemo.activitys.LoginActivity.onRegisterClick(LoginActivity.java:40)
        at java.lang.reflect.Method.invoke(Native Method) 
        at android.view.View$DeclaredOnClickListener.onClick(View.java:5629) 
        at android.view.View.performClick(View.java:6597) 
        at android.view.View.performClickInternal(View.java:6574) 
        at android.view.View.access$3100(View.java:778) 
        at android.view.View$PerformClick.run(View.java:25885) 
        at android.os.Handler.handleCallback(Handler.java:873) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6669) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
I/Process: Sending signal. PID: 14631 SIG: 9
Application terminated.

Cause of error

Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.imoocmusicdemo/com.example.imoocmusicdemo.activitys.RegisterActivity}; have you declared this activity in your AndroidManifest.xml?

resolvent: AndroidManifest.xml Add registeractivity

Common error: uncaught typeerror: document.getElementsByClassName (…).addEventListener is not a function

Problems encountered in the development of native front end:

Uncaught TypeError: document.getElementsByClassName(...).addEventListener is not a function......

reason:

The

    selector did not select the element object correctly
    the document.getElementsByClassName (… )What is captured is the array
solution of the class name element

    document.getElementsByClassName (… )[0].addEventListener…
    Select the required element object through [0]

Concat error caused by tensorflow version

Error prompt:

TypeError: Expected int32, got list containing Tensors of type ‘_ Message’ instead.

Error Description:

Follow the prompts to know a line of concat related code in the code.
This is due to an error in the tensorflow version.

In the API of tensorflow Version (0. X) before 1.0, the parameters of concat are numbers first and tensors second

tf.concat(3, net, name=name)

In the API after tensorflow 1.0, the parameters of concat are tensors first and numbers second

tf.concat(net, 3, name=name)

Because the reference code may be running different tensorflow version from the native version, there is a problem.

Solution:

Find the corresponding code line according to the error prompt, and change the order of concat parameters to run successfully.


copyright: http://blog.csdn.net/cloudox_
Reference: http://blog.csdn.net/zcf1784266476/article/details/71248799

appear Error:java : javacTask: source release 1.7 requires target release 1.7

The following error occurred during compiling java code using idea:

Error:java : javacTask: source release 1.7 requires target release 1.7

Above:

When such a problem occurs, you can set it in settings:

Here, set the compiler version to 1.7. One is to set project, two is to set module.

If you build with maven, you can directly specify the compiled version of Java in POM. Add the following code:

    <build>
        <finalName>5_mybatis_maven</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

Then select pom.xml Right click reinport to let Maven download the corresponding plug-ins

Now to compile, is not to see the rain in the rainbow!

Reference link:

http://stackoverflow.com/questions/12900373/idea-javac-source-release-1-7-requires-target-release-1-7

Python TypeError: ‘newline’ is an invalid keyword argument for this function

Write a code saved as a CSV file

 with open(outputFile, 'w', newline='') as csvfile:
     writer = csv.writer(csvfile)
     for item in sortsim:
         writer.writerow([item[0], item[1], item[2]])

Something’s wrong

Traceback (most recent call last):
  File "/data/ml/shan-als.py", line 54, in <module>
    with open(outputFile, 'w', newline='') as csvfile:
TypeError: 'newline' is an invalid keyword argument for this function

Guess is the reason for the version, plus the version of judgment.
Py2 can use ‘WB’, PY3 can use newline = ‘.

    import sys
    if sys.version >= '3':
        with open(outputFile, 'w', newline='') as csvfile:
            writer = csv.writer(csvfile)
            for item in sortsim:
                writer.writerow([item[0], item[1], item[2]])
    else:
        with open(outputFile, 'wb') as csvfile:
            writer = csv.writer(csvfile)
            for item in sortsim:
                writer.writerow([item[0], item[1], item[2]])

Eclipse: unable to open editor: no ID org.eclipse.jdt . ui.CompilationUnitEditor Editor descriptor for

Eclipse: unable to open editor: no ID org.eclipse.jdt . ui.CompilationUnitEditor Eclipse: could not open the editor: no editor descriptor for ID org.eclipse.jdt . ui.CompilationUnitEditor )

 

As you can see here, a workaround for your problem is just move the “~/.eclipse” to another folder.

So:

    Close EclipseOpen “Terminal”Type the following command:

e.g.:

mv ~/.eclipse somewhereYouWant

When I got this problem, I just:

mv ~/.eclipse home/paladini/Downloads