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

Windows activate does not work in a batch file #794

Closed
asmeurer opened this issue Jul 3, 2014 · 6 comments
Closed

Windows activate does not work in a batch file #794

asmeurer opened this issue Jul 3, 2014 · 6 comments
Labels
cli pertains to the CLI interface locked [bot] locked due to inactivity os::windows relevant to Windows

Comments

@asmeurer
Copy link
Contributor

asmeurer commented Jul 3, 2014

See https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/QMwqUbaVQDc. If you run

activate py33
python -V

in a batch file, it does not work, but if you run

activate py33 && python -V

it does. I did not verify it yet.

@wulmer
Copy link
Contributor

wulmer commented Aug 2, 2014

I think when running these commands from inside a batch file, activate and deactivate should be used together with the call statement:

call activate py33
python -V
call deactivate
python -V

This gives for me correctly:

Activating environment "py33"...
Python 3.3.5 :: Continuum Analytics, Inc.
Deactivating environment "py33"...
Python 2.7.7 :: Anaconda 2.0.1 (64-bit)

@djhoese
Copy link

djhoese commented Oct 19, 2015

I ran in to this issue myself and I'm really happy I found this report after spending way too long trying to find my own work around. Using call seemed to work as I expected. I was able to do stuff like:

call activate myenv || echo It Failed

This was on a Windows 7 laptop.

@wulmer
Copy link
Contributor

wulmer commented Dec 23, 2015

@msarahan I think this issue can be closed.

@msarahan
Copy link
Contributor

Thanks @wulmer, agreed. Thanks also @davidh-ssec for the example of how to activate in a script.

@Mathnerd314
Copy link

It would be nice if this was documented somewhere more obvious, e.g. under https://conda.io/docs/using/envs.html#change-environments-activate-deactivate

@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Sep 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cli pertains to the CLI interface locked [bot] locked due to inactivity os::windows relevant to Windows
Projects
None yet
Development

No branches or pull requests

6 participants