简体   繁体   中英

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.

Steps taken:

1 . Download python 3.10 64bit from pyton.org

2. anaconda prompt: 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)

4. check python version in venv: did not change, still 3.6.

note: command prompt displays Python was not found when passed python --version which is inconsistent with tutorials I have watched. I thought that because I was using anaconda, possibly I was to follow the same steps as the tutorials but in anaconda prompt. Maybe this was an incorrect assumption.

If I check the version in my base environment, it is 3.10. This happened automatically upon downloading python 3.10.

Thanks for your help!

You seem to be mixing up venv and 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. I'm not even sure how venv handles the command you have provided.

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 . (This is also what the conda project recommends .)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM