Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I switch using pip between system and anaconda

I am now using anaconda pip after I installed pip by "conda install pip", if I want to use system pip again, how can I make it? Or how can I switch system pip to anaconda pip?

like image 556
Kun Avatar asked Sep 16 '15 14:09

Kun


People also ask

Can you use both pip and Anaconda?

pip is the standard package manager for python, meaning you can use it both inside and outside of Anaconda.

Is Anaconda same as pip?

The fundamental difference between pip and Conda packaging is what they put in packages. Pip packages are Python libraries like NumPy or matplotlib . Conda packages include Python libraries (NumPy or matplotlib ), C libraries ( libjpeg ), and executables (like C compilers, and even the Python interpreter itself).


2 Answers

Odds are that anaconda automatically edited your .bashrc so that anaconda/bin is in front of your /usr/bin folder in your $PATH variable. To check this, type echo $PATH, and the command line will return a list of directory paths. Your computer checks each of these places for pip when you type pip in the command line. It executes the first one it finds in your PATH.

You can open /home/username/.bashrc with whatever text editor you choose. Wherever it adds anaconda/bin to the path, with something like export PATH=/anaconda/bin:$PATH , just replace it with export PATH=$PATH:/anaconda/bin

Note though, this will change your OS to use your system python as well. Instead of all of this, you can always just use the direct path to pip when calling it. Or you can alias it using alias pip=/path/to/system/pip. And you can put that line in your .bashrc file in order to apply it whenever you login to the pc.

like image 68
Charlie Haley Avatar answered Oct 02 '22 04:10

Charlie Haley


You don't need to change your path. Just use the full path to the system pip (generally /usr/bin/pip or /usr/local/bin/pip) to use the system pip.

like image 39
asmeurer Avatar answered Oct 02 '22 03:10

asmeurer