简体   繁体   English

在anaconda虚拟环境更新python

[英]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 .您似乎混淆了venvconda 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.

相关问题 Anaconda - 更新特定虚拟环境中的软件包 - Anaconda - updating packages in a specific virtual environment 在pycharm中使用anaconda(导入库错误,更新anaconda和虚拟环境) - Use anaconda in pycharm (Import libraries error, updating anaconda and virtual environment) 具有Python / Anaconda虚拟环境的Ubuntu AWS上的Cron - Cron on Ubuntu AWS with Python/Anaconda Virtual Environment Anaconda 2 中未创建 python 3.7.4 的虚拟环境 - Virtual environment with python 3.7.4 not created in Anaconda 2 将Anaconda安装到虚拟环境中 - Installing Anaconda into a Virtual Environment 系统 Python 虚拟环境“发现”了 Anaconda 而不是 Python - 如何防止这种情况发生? - System Python virtual environment 'finds' the Anaconda Python instead - how to prevent this? 在 Anaconda/Python 中,如何在启动 Anaconda 提示符时将我的虚拟环境设置为默认环境? - In Anaconda/Python how to make my Virtual Environment as default environment when starting Anaconda Prompt? 如何在 Mac 上使用 anaconda 虚拟环境运行 python 脚本 - How to run a python script using an anaconda virtual environment on mac 在anaconda虚拟环境中使用activate和直接调用python的区别 - Difference of using activate & directly call python in anaconda virtual environment 如何将 Python 虚拟环境库从 miniforge 放回 anaconda? - How to put Python virtual environment base back from miniforge to anaconda?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM