How to run Anaconda side by side with other Pythons

The Anaconda distribution of Python packs a terrific numerous libraries and tools for info science and scientific computing beneath a one roof. Its attraction goes over and above scientific number crunching, nevertheless. Anaconda is also handy as a general intent Python distribution.

But Anaconda arrives with its share of snares and subtleties. What if you’re utilizing Anaconda together with other Python distributions, and you don’t want them stepping on just about every other’s toes? How do you combine Anaconda proficiently with your other Python tooling, like IDEs? And if you make your mind up you just want to use standard Python, how do you take out Anaconda without breaking anything at all else?

In this posting, we’ll appear at how to established up and operate with Anaconda together with standard variations of Python on the identical program. This posting assumes you previously have some variation of Python installed and you have a standard performing awareness of Python right before getting commenced. Notice also that most of the assistance here pertains to running Anaconda on Microsoft Windows.

Setting up Anaconda with other Pythons

When you run the Anaconda installer, you will not be greeted with a terrific numerous selections. But the few selections you are presented with make all the distinction when getting Anaconda to coexist with other Python installations.

The initial selection really worth modifying is in the “Select Installation Type” menu, where by you select between setting up Anaconda for Just Me or All Customers. If you’re on a pc where by you have admin privileges, selecting All Customers makes everyday living a terrific deal a lot easier, so find that selection if you can. If you select Just Me, the default choice is a subdirectory in your consumer profile, which may be a little tougher to uncover by default, but is nonetheless available as long as you know the route.

anaconda setup 0 IDG

Opt for the All Customers install selection if attainable, as this will allow for you much more freedom in conditions of where by to place the Anaconda directory.

On the following menu site, you’ll be presented the probability to modify the directory where by Anaconda is installed. To make Anaconda simply available, place it in a directory (where by you have generate permissions) that is as higher up on the drive as attainable. For instance, on my program, I have the D: drive reserved for applications, so I use D:Anaconda3 as my Anaconda install directory. You may not be capable to use a directory off the root of a drive if you’re setting up as Just Me, but the less difficult the route to Anaconda, the much better.

anaconda setup 1 IDG

Use an install directory that is as near to the root of your drive as attainable, for the sake of earning its route effortless to uncover.

Here’s the big rationale you’ll want an simply available route: When you established up Anaconda to co-exist unobtrusively with other Python installations, you may will need to manually specify the route to the Anaconda interpreter, for the reason that it may possibly not always be car-detected, and for the reason that (by style and design) it will not be in your system Path. The a lot easier it is to uncover, the much less headache later on.

On the following set up display screen, you’ll be presented with two selections: “Add Anaconda3 to the system Path environment variable,” and “Register Anaconda3 as the program Python 3.seven.” Uncheck both options. The initial helps prevent current Python installations from having their Path references short-circuited by Anaconda. The next keeps your current Python set up registered as the default interpreter in the Windows Registry.

anaconda setup 2 IDG

Uncheck both of these State-of-the-art Selections to be certain that Anaconda doesn’t disrupt any current Python configurations.

Complete the relaxation of the install commonly.

Working with Anaconda virtual environments in a command line

The moment you’ve finished Anaconda set up, you’ll will need to configure command-line access to your Anaconda environments. This can be tough for the reason that of the way Anaconda’s surroundings program is effective: For Anaconda to operate properly, it has to activate at least 1 surroundings, this kind of as the foundation environment. Just launching Anaconda’s python executable doesn’t do this.

Anaconda provides some shortcuts to launching shell classes with the foundation environment activated. For instance, in Windows, an Anaconda PowerShell Prompt shortcut seems in the Start off menu soon after you install Anaconda. Click this shortcut, and you’ll start a PowerShell session with the foundation environment activated.

What if you don’t want to use the shortcut, but just want to trigger activation in any PowerShell instance you transpire to be in? This is trickier, for the reason that you have to execute the identical activation regime utilised in the shortcut.

Copyright © 2020 IDG Communications, Inc.