Windows 下 Conda 虚拟环境不变

2022-01-10 00:00:00 python windows conda anaconda

问题描述

我已经为 Windows 安装了 Anaconda 2.2.0 并通过以下方式创建了一个虚拟环境:

I have installed Anaconda 2.2.0 for Windows and created a virtual environment via:

> conda create -n my-env anaconda

环境已成功创建,我在我的环境列表中看到它(实际上该目录位于 Anacondaenvs..)

The environment is sucessfully created and I see it in my list of envinronments (and indeed the directory is there in Anacondaenvs..)

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

但是,当运行 activate.bat 脚本来切换环境时,虽然看起来成功,但实际上并没有进行切换:

However, when running the activate.bat script to switch envinronment, although it appears to be successful the switch isn't actually made:

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

* 表示活动环境.

我在 Windows 上看到了一些 conda activate 问题,但没有发现这个具体问题.

I have seen some issues with conda activate on Windows but haven't found this sepecific issue.

更多信息:我希望复制整个 Anaconda 包分发,然后在一个包上安装开发版本.

For further info: I am looking to copy the whole Anaconda package distribution and then install a dev version over one package.


解决方案

如果你使用的是Powershell,activate目前不支持.您将需要手动修改 PATH,或者使用 cmd shell.

If you are using Powershell, activate currently does not support it. You will need to modify your PATH manually, or else use the cmd shell.

相关文章