How to upgrade to the latest Anaconda 5.0.1 - python

I have Anaconda 4.4.0 (Windows, Python 3.6., 64 bit).
I would like to upgrade to latest Anaconda 5.0.1
Few options:
Download the full installer and run it
From existing installation (of 4.4.0) run "conda update --all"
From existing installation run "conda update anaconda"
What is the tradeoff among these options? What is the recommended one?

Download the full installer: Provided that you uninstall your existing Anaconda, this method will be least likely to cause upgrade problems. It will also probably be slower. Note that I think you should uninstall the old Anaconda so that you don't end up with two conda[.exe] files, two Anaconda Prompt shortcuts, and so forth. You may end up trying to install a package with the wrong conda and be very confused about what's happening.
conda update --all: This will update all of your packages in the environment to their latest version, regardless of their version in the Anaconda installer. This is not recommended because you will end up with package versions that are different from the ones in the Anaconda installer and you may end up with an error message about packages that are incompatible.
conda update anaconda: This will update the "metapackage" called anaconda to the latest version. This package has dependencies on specific versions of all of the packages and Anaconda (the company) give some assurance that these will all work together. So, updating the anaconda package will update all your packages to the version used in the latest version of the Anaconda installer.
My suggestion (based on some experience, I am not an employee of Anaconda) would be to try #3 and if it fails, try #1.

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.

Installing tensorflow gpu in anaconda 5.3

I have recently installed anaconda 5.3 and it came with python 3.7 preinstalled. Now when I checked tensorflow website it's says tensorflow does not support 3.7 only 3.6.
Tensorflow Requires Python 3.4, 3.5, or 3.6
What can I do now to have tensorflow gpu for my pc. Any help is appreciated. Is there any workaround?
Thanks.
You should create a new conda virtual environment with python 3.6, then install tensorflow into that.
At the creation of the new env you can freely choose the python version you want to use.
This is one of the essence of conda and virtual envs in general.
A bit more details:
Inside of the anaconda-navigator you can choose Environments, then choose create. Here you can give the new environment name and the packages basis i.e. Python or R and the versions you want to use it for the environment. Then you have to install your custom packages beside of the default ones. Here you can install tensorflow-gpu too.
For installing packages you can choose Anaconda navigator GUI or inside of the Anaconda command shell with conda conda install <package> or in the Anaconda command shell pip install <package>.
In general you should prefer Anaconda package management i.e. GUI or conda to the package versions be consistent, what conda manages well. In some cases -choose always the package developer's suggestion- however, you may choose pip install.

Is it possible to lock versions of packages in Anaconda?

I installed Anaconda 3 2.3.0 on Windows xp. It is supposed to be the last version of anaconda to support windows xp as it contains python 3.4.3, and python 3.4.x is the last version of python to support windows xp.
When installing a package with
conda install
,one of its dependencies was updating conda to conda 4.x. conda 4.x crashed in the commandline when running conda install . This made anaconda unusable that i uninstalled anaconda.
My question, is it possible to lock versions of packages ? For the two use cases:
lock and forget : for packages I never want them to update, i need to run a command to lock them once so they will never update as a depency
ignore updating : install a package while ignoring to update certain package passed by name in this update.
If only one of the 2 use cases is possible or is known or is easier, please write it as answer.
There are two bits to this. First, you can prevent conda from auto-updating by changing the configuration option auto_update_conda to False:
conda config --set auto_update_conda False
The other bit is to pin packages to certain versions. For those packages you don't want to update, you can pin the version by adding a line to a file called pinned (you might need to create it) in the environment's conda-meta directory. The syntax is
[The code] below [placed in conda-meta/pinned] forces NumPy to stay on the 1.7 series, which is any version that starts with 1.7, and forces SciPy to stay at exactly version 0.14.2:
numpy 1.7.*
scipy ==0.14.2
See the documentation for more information.
Pin for conda install (=): package=1.0
vs.
Pin for pip install (==): package==1.0
Try
pip install <package name==version no*>
for instance
pip install musdb==0.2.*
That would pin your package

Which is the correct command to update all anaconda python packages?

I am using python Anaconda. I am confused which is the correct command to update all the Anaconda packages to the latest version. There seems to be 2 commands that can be used;
$ conda update --all
or
$ conda update anaconda
After running the latter, anaconda was upgraded to ver4.4. Subsequently, I run the former which asked if I wanted to downgrade some packages. This is what confused me. Which is the correct command to use?
The anaconda package is a "meta"-package, which means that it doesn't contain any packages itself, it merely sets the specific version of a number of packages that Anaconda Inc. (formerly Continuum IO) include with the "Anaconda distribution". Therefore, when you type
conda update anaconda
you are telling conda to update to the most recent version of the anaconda package, and install all the dependencies with their specific versions as specified in the anaconda package. This has the advantage that Anaconda Inc. (formerly Continuum IO) have tested the packages together and are making some assurance that there won't be any conflicts.
When you type
conda update --all
conda uses its internal algorithm to try and resolve the versions of the dependencies. I'm not sure of the details, but this may result in some packages being upgraded, but others being downgraded because some package that you have installed requires a downgraded version of the dependency. Particularly with the number of packages installed by the anaconda meta-package, conflicts are sure to happen, and conda is doing its best to resolve all those.
As for which to use, I'd say that if you started with anaconda, keep going with anaconda to avoid version conflicts (i.e., conda update anaconda). However, if you have a fresh environment or you're using Miniconda where you don't have the anaconda meta-package installed, then conda update --all is probably the better choice. Your mileage may vary.

Categories

Resources