我刚刚使用conda create --name py35 python=3.5 anaconda
我依次添加了anaconda的bin,envs和py35的PATH变量路径,但没有效果。
我总是得到同样的错误:
>>> source activate py35
activate: No such file or directory.
>>> activate py35
Error: activate must be sourced. Run 'source activate envname'
instead of 'activate envname'.
Usage: source activate ENV
adds the 'bin' directory of the environment ENV to the front of PATH.
ENV may either refer to just the name of the environment, or the full
prefix path.
>>> cd anaconda/bin
>>> ls | grep activate
activate
activate-global-python-argcomplete
deactivate
>>> source activate py35
Illegal variable name.
我很困惑
编辑:echo $PATH
给出
/local/home/sread/Apps/texlive/2015/bin/x86_64-linux:/local/home/sread/Apps/anaconda:/local/home/sread/Apps/anaconda/bin:/local/home/sread/Apps/texlive/2015/bin/x86_64-linux:/local/home/sread/Apps/anaconda/envs:/local/home/sread/Apps/anaconda/bin:/local/home/sread/Apps/texlive/2015/bin/x86_64-linux:/local/home/sread/Apps/anaconda/envs/py3k:/local/home/sread/Apps/anaconda/bin:/local/home/sread/Apps/texlive/2015/bin/x86_64-linux:/local/home/sread/Apps/anaconda/envs:/local/home/sread/Apps/anaconda/bin:/local/home/sread/Apps/texlive/2015/bin/x86_64-linux:/local/home/sread/Apps/anaconda/bin:/local/home/sread/Apps/texlive/2015/bin/x86_64-linux:/local/home/sread/Apps/anaconda/bin:/star/java/jre/bin:/star/java/bin:/soft/cuter:/soft/cuter/CUTEr.large.pc.lnx.gfo/bin:/soft/sifdec:/soft/sifdec/SifDec.large.pc.lnx.gfo/bin:/local/home/sread/Apps/texlive/2015/bin/x86_64-linux:/local/home/sread/Apps/anaconda/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/soft/bin:/soft/AstroMatic/bin:/star/bin/startcl:/star/bin:/star/starjava/bin
答案 0 :(得分:0)
我认为命令需要在系统提示符下运行,而不是python提示符(>>>)。在运行之前尝试退出python"激活envname"或者" source activate envname"如果你分别在Windows或Linux上。