Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python packages duplicates installed with pip and conda

I'm trying to deal with iPython and the associated tools, but and in the process, I ended up installing ipython, numpy, scipy and other packages on both pip and conda (conda comes with a bunch of these goodies).

Any ideas/suggestions on what to do about resolving this? It hasn't caused me any problems yet, but I'm afraid it will be a big headache at some point. I have no idea now what python is importing now and when I run ipython, I don't seem to have control over which installation is running.

I guess I could just uninstall pip and all its packages... Does that sound good?

Thanks

like image 818
Chet Avatar asked Feb 04 '14 06:02

Chet


1 Answers

A couple of points of clarification:

  • conda is the packaging tool used in the Anaconda python distribution. So, when you say "conda comes with a bunch of these goodies", I'm assuming you mean Anaconda.
  • If you pip installed a bunch of packages, and then installed Anaconda, you should be fine: After a successful installation of Anaconda, the python interpreter that loads up will be the Anaconda python, and it will see all of the packages included with the distribution.
  • If you have Anaconda installed, you should not have needed to use "pip" to install any of those packages.
  • If you do "which python", you will see the path to the python interpreter you fire up. If this path has "anaconda/" anywhere in it, then you're using Anaconda python. Additionally, the very first line that shows up when you run python in interactive mode should also have "Anaconda 1.x.x" right after the Python version.
  • One thing that can sometimes trigger oddness is if your PYTHONPATH environment variable is set, and is pointing to various directories that include additional packages that might be incompatible with the tested set of packages in Anaconda.

You shouldn't need to uninstall pip itself, just the packages that are duplicates of the ones included in Anaconda. But, as I said before, if you have an actual installation of Anaconda, it should basically be able to run self-contained and independent of any packages you installed before, unless you have a PYTHONPATH set.

like image 67
Peter Wang Avatar answered Nov 13 '22 10:11

Peter Wang