Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activate.bat broken for path containing spaces on windows #830

Closed
stippingerm opened this issue Jun 17, 2016 · 7 comments · Fixed by conda/conda#2740
Closed

activate.bat broken for path containing spaces on windows #830

stippingerm opened this issue Jun 17, 2016 · 7 comments · Fixed by conda/conda#2740

Comments

@stippingerm
Copy link

Updating packages

    conda:        4.0.5-py35_0       --> 4.1.1-py35_0
    conda-env:    2.4.5-py35_0       --> 2.5.0-py35_0
    matplotlib:   1.5.1-np110py35_0  --> 1.5.1-np111py35_0
    mkl:          11.3.1-0           --> 11.3.3-1
    mkl-service:  1.1.2-py35_0       --> 1.1.2-py35_1
    numexpr:      2.5-np110py35_0    --> 2.5.2-np111py35_1
    numpy:        1.10.4-py35_0      --> 1.11.0-py35_1
    pandas:       0.18.0-np110py35_0 --> 0.18.1-np111py35_0
    scikit-learn: 0.17.1-np110py35_0 --> 0.17.1-np111py35_1
    scipy:        0.17.0-np110py35_0 --> 0.17.0-np111py35_4

will break Scripts/activate.bat under Windows if the install path contains spaces. (Replacing activate.bat with the original one just works fine.)

I have installed Anaconda to "C:\Program Files\Anaconda3"
After starting updated Anaconda prompt, instead of

Deactivating environment "C:\Program Files\Anaconda3"...
Activating environment "C:\Program Files\Anaconda3"...
[Anaconda3] C:\Windows\system32>

I get:

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\system32>

I experienced the same issue with Anaconda 2.5 (Python 3.5) as well therefore I moved to Anaconda 4 hoping it resolves the problem. Vanilla install was fine but the above package update broke the script again.
Users with the broken script might be unable to switch environment.

@EvenOldridge
Copy link

This has just happened to me, and somehow the updating of the packages completely removed my activate.bat file. As in it no longer exists in /scripts

The above solution (of replacing activate.bat) doesn't seem to be an option anymore as it's not a part of the conda repository. Where do I find a copy of it?

@mingwandroid
Copy link

mingwandroid commented Jun 14, 2017

@EvenOldridge you are reporting something quite different here from spaces being mishandled in activate.bat. You are reporting the disappearance of that file, likely caused by a virus scanner. Conda stores a package cache in the pkgs folder. You should be able to find activate.bat in the conda-<<version>>\Scripts subfolder of that.

@sajidnisar
Copy link

sajidnisar commented Jun 14, 2017

@mingwandroid Same has just happened with me. Activate.bat is also not available in conda-<>\Scripts folder. Probably, removed from there as well.

PS: I detected windows malicious software tool working hard right before this. Your point about virus scanner seems correct. But, what could be the solution?

@mingwandroid
Copy link

Use a better virus scanner?

I'm not an expert in the field but I've read recommendations to only use the inbuilt Windows Defender.

@sajidnisar
Copy link

@mingwandroid Thanks. Already using Windows Defender (only).
I was able to find the backup bat file in Anaconda3\pkgs\conda-<>\Scripts. However, it was not in the latest version. Found it in the second to latest version of conda. Updated conda after pasting file in conda-<>\Scripts and it's working fine. Hurray!

@ccscroggin
Copy link

I am having the same issue. Adding the activate.bat file from the backup helped me get past the first issue, but now I get a different error - no module named 'conda'. I am guessing I am having issues with virus scanner removing files (I am on work computer). Any ideas?
image

@sajidnisar
Copy link

If the activate.bat file from the latest backup isn't working, I'd suggest using it from the second latest backup. In my previous experience, that had worked and the issue was resolved after updating conda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants