[英]Updating python in anaconda virtual environment
I am trying to update my python version in an anaconda3 virtual environment from 3.6 to 3.10.我正在尝试将 anaconda3 虚拟环境中的 python 版本从 3.6 更新到 3.10。
Steps taken:采取的步骤:
1 . 1 . Download python 3.10 64bit from pyton.org
从 pyton.org 下载 python 3.10 64 位
2. anaconda prompt: conda activate gis
(my venv) 2. anaconda 提示:conda
conda activate gis
(my venv)
3. anaconda prompt: (gis) C:\User\User>python -m venv --upgrade "C:/Users/User/anaconda3/envs/gis"
(path to my virtual environment) 3. anaconda 提示:
(gis) C:\User\User>python -m venv --upgrade "C:/Users/User/anaconda3/envs/gis"
(我的虚拟环境路径)
4. check python version in venv: did not change, still 3.6. 4.在venv中查看python版本:没变,还是3.6。
note: command prompt displays Python was not found
when passed python --version
which is inconsistent with tutorials I have watched.注意:命令提示符显示
Python was not found
when passed python --version
这与我看过的教程不一致。 I thought that because I was using anaconda, possibly I was to follow the same steps as the tutorials but in anaconda prompt.我认为因为我使用的是 anaconda,所以我可能要按照与教程相同的步骤进行操作,但会出现 anaconda 提示。 Maybe this was an incorrect assumption.
也许这是一个错误的假设。
If I check the version in my base
environment, it is 3.10.如果我检查我的
base
环境中的版本,它是 3.10。 This happened automatically upon downloading python 3.10.这在下载 python 3.10 时自动发生。
Thanks for your help!谢谢你的帮助!
You seem to be mixing up venv
and conda
.您似乎混淆了
venv
和conda
。 Your environment is managed by conda
(which is a project separate from the Python language), whereas venv
is the de facto virtual environment manager used within the Python language.您的环境由
conda
(它是一个独立于 Python 语言的项目)管理,而venv
是 Python 语言中使用的事实上的虚拟环境管理器。 I'm not even sure how venv
handles the command you have provided.我什至不确定
venv
如何处理您提供的命令。
If having 3.10 is a priority, I would suggest that you create a new conda
environment using 3.10
and install any packages from your previous 3.6
environment .如果优先考虑 3.10,我建议您使用
3.10
创建一个新的conda
环境,并安装之前3.6
环境中的所有包。 (This is also what the conda project recommends .) (这也是conda项目推荐的。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.