[英]How do I set a different Python version in my environment from my base environment?
My base environment's Python version is the 3.7, the way I like it.我的基础环境的 Python 版本是 3.7,我喜欢它。 However, I need to create a new environment that uses Python version 3.5.
但是,我需要创建一个使用 Python 版本 3.5 的新环境。
I created my environment specifying version 3.5:我创建了指定版本 3.5 的环境:
conda create --name dbconnect python=3.5
However, when I activate my environment ( conda activate dbconnect
) and check for the python version ( python --version
), I get但是,当我激活我的环境(
conda activate dbconnect
)并检查 python 版本( python --version
)时,我得到
(dbconnect) computer-name:src vivian$ python --version
Python 3.7.3
I tried downgrading the Python version in the dbconnect
environment by running conda install python=3.5
and get this我尝试通过运行
conda install python=3.5
在dbconnect
环境中降级 Python 版本并得到这个
(dbconnect) computer-name:src vivian$ conda install python=3.5
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
It appears to have worked but it hasn't because when I check the Python version, it is still 3.7.3它似乎有效,但没有,因为当我检查 Python 版本时,它仍然是 3.7.3
(dbconnect) computer-name:src vivian$ python --version
Python 3.7.3
The only way to have my dbconnect
environment have Python version 3.5 is to downgrade the Python version in my base environment, but I do not want to do that.让我的
dbconnect
环境具有 Python 版本 3.5 的唯一方法是在我的基本环境中降级 Python 版本,但我不想这样做。 How do I have my dbconnect
environment use Python 3.5 and my base environment use Python 3.7?如何让我的
dbconnect
环境使用 Python 3.5 而我的基础环境使用 Python 3.7?
Sharing the answer as per the comment by the original poster:根据原始发布者的评论分享答案:
"I figured it out. My environment variables were getting messed up because my. bash_profile
was bad". “我想通了。我的环境变量搞砸了,因为我的
bash_profile
很糟糕”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.