我在Linux下有如下conda环境:
I have the following conda environment under Linux:
$ conda info -e
# conda environments:
#
py33 /u21/coyotito/.anaconda/envs/py33
root * /u21/coyotito/.anaconda
而 py33 是用这个命令创建的:
And py33 is created with this command:
$ conda create -n py33 python=3.3 anaconda
问题是当我激活 py33 时它仍然无法调用 Python 3.3 版本.
The problem is when I activate py33 it still cannot call Python version 3.3.
[coyotito@pearl ~]$ source activate py33
(coyotito)[coyotito@pearl ~]$ python --version
Python 2.7.10 :: Anaconda 2.1.0 (64-bit)
(coyotito)[coyotito@pearl ~]$ conda info -e
# conda environments:
#
py33 /u21/coyotito/.anaconda/envs/py33
root * /u21/coyotito/.anaconda
即它仍然调用旧的python.还要注意括号下的提示不是 (py33).
Namely it still calling old python. Notice also that the prompt under bracket is not (py33).
(coyotito)[coyotito@pearl ~]$ which python
~/.anaconda/bin/python
在新环境中代替python:
Instead of python in new environment:
~/.anaconda/envs/py33/bin/python3.3
我该如何解决这个问题?
How can I resolve this issue?
更新
我在 ~/.bash_profile 中的 PATH 环境如下所示:
My PATH environment in ~/.bash_profile looks like this:
export PATH=$HOME/.anaconda/bin:$PATH
我遇到了完全相同的问题.不知道我做了什么来陷入这种混乱,但我用一个简单的方法解决了它:
I had the exact same problem. Not sure what I did to get into that mess, but I solved it with a simple:
conda deactivate
conda activate foo_env
(如果激活了多个环境,可能需要多次运行conda deactivate.)
(If you have activated multiple environments, you may need to run conda deactivate multiple times.)
这篇关于为什么 Conda 激活环境后无法调用正确的 Python 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
使用 python 解析非常大的 xml 文件时出现问题Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件时出现问题)
使用 Python 2 在 XML 中按属性查找所有节点Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按属性查找所有节点)
Python - 如何解析 xml 响应并将元素值存储在变量中Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 响应并将元素值存储在变量中?)
如何在 Python 中获取 XML 标记值How to get XML tag value in Python(如何在 Python 中获取 XML 标记值)
如何使用 ElementTree 正确解析 utf-8 xml?How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正确解析 utf-8 xml?)
将 XML 从 URL 解析为 python 对象Parse XML from URL into python object(将 XML 从 URL 解析为 python 对象)