I installed Anaconda 64 python 2.7 on Windows 7 64-bit version. After installation, the anaconda prompt can start with no problem. But whenever I restart/shutdown and restart th
What worked for me with the same error.
Create another system variable P1 with the variable value being the location of where your Anaconda install is (mine is here):
C:\Program Files (x86)\Anaconda3\
In your PATH variable, put these two at the front:
%P1%\envs;%P1%\Scripts\;everything_else_here
Restart command prompt and try to activate env again.
I found that if you change from using single quotes for the CALL SET on the following:
REM Make sure that root's Scripts dir is on PATH, for sake of keeping activate/deactivate available.
CALL SET "PATH_NO_SCRIPTS=%%PATH:%SCRIPT_PATH%=%%"
IF "%PATH_NO_SCRIPTS%"=="%PATH%" SET "PATH=%PATH%;%SCRIPT_PATH%"
to:
REM Make sure that root's Scripts dir is on PATH, for sake of keeping
activate/deactivate available.
CALL SET ""PATH_NO_SCRIPTS=%%PATH:%SCRIPT_PATH%=%%""
IF "%PATH_NO_SCRIPTS%"=="%PATH%" SET "PATH=%PATH%;%SCRIPT_PATH%"
Solves this issue for me. This is based upon this answer
I had the same problem, it also occurs with activating environments created with conda. Because I was annoyed for a long time by problems from a messy Windows PATH, my solution was to create a little python tool to declutter the PATH variable. It is available via a
>pip install pywinpath
followed by
>pywinpath
Or you can copy & paste the source code from the single file https://github.com/czamb/pywinpath/blob/master/pywinpath.py
Or download the bundled .exe from https://github.com/czamb/pywinpath/releases
Then after you PATH fits inside the Windows length restrictions, you can add Anaconda's entries at the beginning of your user or system PATH. The relevant entries can be found by calling the Anaconda Promt and entering echo %PATH%, they are the first three entries.
There are also other tools to edit the Windows PATH variable: https://superuser.com/questions/297947/is-there-a-convenient-way-to-edit-path-in-windows-7