Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update Python in Anaconda base environment?

How can I update Python in the Anaconda base environment? Is Python intended to be upgradable in the base environment at all, or should one completely remove and reinstall Anaconda? Any version will eventually go out of support, so there should be some solution.

What I have tried so far, and did not result in Python getting updated:

  • conda update --all
  • conda update python and conda update anaconda
  • conda install python=3.9 or conda install anaconda=2021.11 do not finish after an hour and a half.
  • mamba install python=3.9 results in "package python_abi-3.7-2_cp37m requires python 3.7.*, but none of the providers can be installed"
  • No other suggestion is put forward here.
like image 370
Szabolcs Avatar asked Sep 13 '25 13:09

Szabolcs


2 Answers

Official documentation by Anaconda advises against upgrading to another major version of Python. It mentions the method you have already tried:

conda install python=3.9

but the process did not finish for you. This is in line with their documentation which says:

It is not recommended, rather it is preferable to create a new environment. The resolver has to work very hard to determine exactly which packages to upgrade.

Instead, you should create a new environment as suggested by the documentation and answers to this question.

conda create -n py39 python=3.9 anaconda
like image 199
Fato39 Avatar answered Sep 15 '25 04:09

Fato39


In the base environment, run mamba update python --no-pin (of course, you could do it with conda, but then you're up for a long wait!).

like image 29
mrgou Avatar answered Sep 15 '25 02:09

mrgou