Upgrade Python and all packages in anaconda base env - python

I am using anaconda and my current python version in it is Python 3.7.10.
I want to upgrade everything: anaconda, the python version (which includes a major version upgrade to 3.8, I read somewhere that that matters), and all anaconda packages within I want to upgrade too.
I want to do this in my base anaconda env i.e. just upgrade everything.
Of course I can do this by uninstalling and then downloading latest version and installing anaconda again. But I want to avoid complete reinstallation.
I was reading the answers here
Upgrade to python 3.8 using conda
but it's not clear to me... how does one do this update in his base env?
Side question: I see version 3.9.2 for Python available here: https://anaconda.org/anaconda/python but the current full download of anaconda includes just Python 3.8. Why is that difference?
How can I do so that I have the latest and greatest of all packages (incl. the python interpreter)? Should I go for Python 3.8 or 3.9? I guess if I install 3.9 some anaconda packages might not work, is that so?

Related

Can't upgrade Anaconda base to Python 3.8

I want to upgrade my base environment to Python 3.8. According to the official documentation, I should just run conda install -c anaconda python. This, however, only upgrades Python 3.7, so, in the end:
(base) C:\Users\bob>conda install -c anaconda python
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
(base) C:\Users\bob>python --version
Python 3.7.6
conda update -c anaconda python only updated a number of packages, but not Python itself.
And if I specify a version, like explained here, after two hours analyzing dependencies, the upgrade fails because of conflicts.
I managed to set up a 3.8 environment, but I'd rather upgrade my base environment as it's the one my system path for use outside of Anaconda.
Any suggestion?
It doesn't appear to be possible to update the base version of anaconda to 3.8 yet because of the conflicts you mention. I assume once all the standard packages are updated to support 3.8+ (and updated versions of all dependencies), then the anaconda release will include 3.8.x as the default. This might take a while.
The problem here is version conflicts in the packages that anaconda installs by default. The reason you can install 3.8 in a clean environment is because no other packages are installed in that environment, so no conflicts.
This does now present a solution, although it requires reinstalling everything from scratch...
disclaimer: I don't use windows, so adapt my instructions accordingly to your OS.
Remove your existing anaconda install from the path and delete
anything in your bashrc (or windows equivalent) that points to it.
You can just delete/uninstall anaconda, but it's good to have a backup just incase, so leaving it there and removing links to it is a good option.
Download and install miniconda, and put it in your path as you had before.
Install python 3.8 in the base environment conda install python=3.8
Install all the packages that you need to do whatever you do.
Depending on what you install, at some point you may run into the same conflicts that prevent a standard anaconda install from updating at the moment, but that hasn't happened for me.
The latest stable version of anaconda is version 3.7
Please see here:
https://www.anaconda.com/distribution/
There isn't an option to get python 3.8, this is due to anaconda sometimes running a version behind the release of python.
I had the same issue and found there is a 2020-07 release of Anaconda with Python 3.8 https://www.anaconda.com/products/individual

Anaconda upgraded to Python3.8 and now is not working

I had Anaconda linked to python3.5, but after the pip upgrade (with conda) the version of Anaconda was also upgraded to python3.8. I need to go back to the python3.5, because I have lots of libraries already installed and configured on python3.5
Conda was also updated and it was not working, but I found how to have miniconda3 working in order to test some commands.
I don't know what to do in order to recover Anaconda linked to python3.5.
Any suggestion will be more than welcome.

Install Anaconda on Ubuntu with preexisting Python

I have Ubuntu 16.04 LTS with Python 2.7 and 3.5. I've set up virtual environments to access both 2.7 and 3.5 separately and everything works fine.
Now, I need to install Anaconda to access some libraries for a class I am taking. Whats the best way to do this without disrupting the virtual environments I have already set up.
Install Miniconda, a mini version of Anaconda that includes just conda, its dependencies and Python.
https://conda.io/docs/user-guide/install/index.html#installing-conda-on-a-system-that-has-other-python-installations-or-packages
You do not need to uninstall other Python installations or packages in order to use conda. Even if you already have a system Python, another Python installation from a source such as the macOS Homebrew package manager and globally installed packages from pip such as pandas and NumPy, you do not need to uninstall, remove, or change any of them before using conda.
Try using documentation of anaconda as most of the dependencies are untouched while installing it

Can the latest Anaconda package for Python 3.6 work for Python 3.5?

I have the 3.5 version of python. I want to install Anaconda, but it says on the Anaconda website the latest version of it is for Python 3.6. My question is could I still use the packages for Python 3.5, or should I install Python 3.6?
When you install Anaconda Python, it installs into its own area and wouldn't conflict with an existing Python installation. If you already have additional Python packages installed, you will need to reinstall them for the new Python installation, preferably using a Python virtual environment. You can't use a Python virtual environment from an existing Python installation and would need to create a new one against Anaconda Python if already using one.
If your own personal code works with Python 3.5, it likely will work with Python 3.6 no problems.
So with the above caveats on re-installing additional Python packages, there shouldn't be any reason why you couldn't use Anaconda Python 3.6.
I had the same problem where I couldn't run anaconda with python 3.6. What I did was to install anaconda with python 3.5. Go to https://repo.continuum.io/archive/ then download Anaconda3-4.2.0-Windows-x86_64.

How do I upgrade python 2.7.8 to 2.7.9 in Anaconda without conflicting other components in its environment?

After successful installation of Anaconda on Windows 7 I realized the default Python version is 2.7.8. However I need 2.7.9. So how do I upgrade?
Unfortunately, you cannot update Python in the root environment of Anaconda on Windows. See https://stackoverflow.com/a/29238416/161801.
Your anaconda installation ships its own package manager conda. You can use it for updating python packages and also the python interpreter.
To update the python interpreter in your default environment, all you have to do is executing the command below from command line:
conda update python
Install newest version of Anaconda from their website. This will upgrade your Anaconda and python as well. Also, uninstall the previous version of Anaconda.

Categories

Resources