简体   繁体   English

Conda虚拟环境在Windows下不会改变

[英]Conda virtual environment not changing under Windows

I have installed Anaconda 2.2.0 for Windows and created a virtual environment via: 我已经为Windows安装了Anaconda 2.2.0并通过以下方式创建了一个虚拟环境:

> conda create -n my-env anaconda

The environment is sucessfully created and I see it in my list of envinronments (and indeed the directory is there in Anaconda\\envs..) 环境是成功创建的,我在我的envinronments列表中看到它(实际上目录在Anaconda \\ envs ..)

> conda info -e
# conda environments:
#
my-env                   D:\Anaconda\envs\my-env
root                  *  D:\Anaconda

However, when running the activate.bat script to switch envinronment, although it appears to be successful the switch isn't actually made: 但是,当运行activate.bat脚本来切换envinronment时,虽然看起来是成功的,但实际上并没有进行切换:

> activate.bat my-env
Activating environment "astropy-dev"...
> conda list -e
# conda environments:
#
my-env                   D:\Anaconda\envs\my-env
root                  *  D:\Anaconda

With the * indicating the active environment. *表示活动环境。

I have seen some issues with conda activate on Windows but haven't found this sepecific issue. 我在Windows上看到了conda激活的一些问题,但没有发现这个特定的问题。

For further info: I am looking to copy the whole Anaconda package distribution and then install a dev version over one package. 有关详细信息:我希望复制整个Anaconda软件包分发版,然后在一个软件包上安装开发版。

If you are using Powershell, activate currently does not support it. 如果您使用的是Powershell,则当前activate不支持它。 You will need to modify your PATH manually, or else use the cmd shell. 您需要手动修改PATH,否则使用cmd shell。

Are you calling activate from within a batch script? 您是否在批处理脚本中调用activate Then it should be call activate my-env . 然后应该call activate my-env

You don't need the .bat. 你不需要.bat。 It's just activate my-env. 它只是激活my-env。

You command 你命令

activate astropy-dev

must be run from the D:\\Anaconda directory. 必须从D:\\ Anaconda目录运行。 Then it should work. 然后它应该工作。 To check, type: 要检查,请键入:

conda info -e

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM