Update Anaconda Navigator

Everybody using Python would nowadays be using Anaconda instead. And if you aren’t, my recommendation is to use it. Why may you ask? Because with python comes a lot of packages and each such package comes with a host load of dependencies and it is difficult & time-consuming to resolve those dependencies manually. Also, anaconda allows one to create multiple environments (basically environment containers for package isolation). So let’s say you need package1 for some type of work and package2 for some other type of work. But package2 inherently depends on a different version of package1. Now if you have the same environment, you will have conflicts but creating different isolated environment containers helps the use case.

Anyways, just use it. Its simple and allows you to spend more time focussing on the business logic. Now then, once you have installed Anaconda and when you launch the Anaconda Navigator application, it will give you an upgrade dialog box showing that a new version is available. If you have installed it somewhere in “Program Files”, the auto-upgrade mechanism will not work. So instead of being frustrated or trying to install it somewhere else, go through the following steps.

1. Open the command prompt using “Run as Administrator” option from Windows Start Menu
2. Go to the location where conda.exe is installed. In my case, it was ” C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\Scripts ” (Yes, I got the anaconda installed with Visual Studio Community Edition :).
3. Execute the following code
conda.exe update --prefix "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64" anaconda-navigator

Now your anaconda-navigator will be upgraded and something similar to the following text will be seen.

Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64:

The following packages will be UPDATED:

anaconda: 5.0.0-py36hea9b2fc_0 --> custom-py36h363777c_0
anaconda-navigator: 1.6.8-py36h4b7dd57_0 --> 1.6.12-py36hdad2993_0
conda: 4.3.27-py36hcbae3bd_0 --> 4.4.7-py36_0
pycosat: 0.6.2-py36hf17546d_1 --> 0.6.3-py36h413d8a4_0

Proceed ([y]/n)? y

anaconda-custo 100% |###############################| Time: 0:00:00 131.17 kB/s
pycosat-0.6.3- 100% |###############################| Time: 0:00:00 662.27 kB/s
conda-4.4.7-py 100% |###############################| Time: 0:00:01 904.57 kB/s
anaconda-navig 100% |###############################| Time: 0:00:02 1.96 MB/s
DEBUG menuinst_win32:__init__(185): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64', env_name: 'None', mode: 'None', used_mode: 'system'
DEBUG menuinst_win32:__init__(185): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64', env_name: 'None', mode: 'None', used_mode: 'system'

Don’t worry about the DEBUG prints, it just says that I have run the command outside of a container environment. Now voila, your anaconda navigator is updated. As a bonus, you might also see a list of packages that are upgradeable in the UI. The UI, unfortunately, will now allow you to carry on the upgrades. Instead, just write the following in an environment window (a python window opened via the environment from anaconda-navigator)

conda update --all

If you run the command outside of an environment, the base/root environment will be updated. You can also use the –name argument to the command to give a specific environment name. Running it from inside a contained environment will only update the packages for that environment. To update the environment itself, you can use  conda env update . Check the conda documentation for the same.

So long people, ENJOY learning!