I'm still trying to understand this problem I'm having and have read a ton of posts regarding sudo apt-get install python-XXX
vs pip install
, and I understand the jist of it (apt-get is a package repo, managed by completely different group of people to pip, auto-updates along with everything else when there is an update available, it's binary etc). However there are a few particular things which I don't understand and haven't been able to find answers to:
If I, for whatever reason, first install a package, e.g. numpy, with
sudo apt-get install numpy
, and then I laterpip install numpy
. What happens? is numpy installed again elsewhere with different version (e.g. in .local/lib), so now I have two independent versions? Which one is used when I import? (if I've understood correctly it is separate and apt-get is system wide, but I've seen conflicting replies to this question, e.g. here)I noticed a lot of the packages on apt-get are quite old compared to pip. e.g. at time of writing ipython 2.3.0 vs 4.0.3, numpy 1.10.2 vs 1.10.4, spyder 2.3.5 vs 2.3.8. Is there any advantage to first
sudo apt-get install
followed by apip install
? or is that just stupid?I noticed that my pip was 1.5.6 - it's the current latest if you do
sudo apt-get install python-pip
. whereas on pip it's 8.0.2! I believe this has been causing me problems, because with that old version you can install the same package over and over again and it doesn't warn. And somehow it doesn't write over the old one. I realized this because I can keep uninstalling the same package (e.g. numpy) and it's still always there when I dopip show numpy
. And oddly, always showing the same folder (.local/), but with different versions :S So I have two questions related to this:a. what is the best way to install pip? I'm currently leaning towards
sudo apt-get install python-pip
,pip install pip
,sudo apt-get purge python-pip
. Is that wise? It seems a bit ridiculous to me.b. now that I know a lot of my packages are messed up with duplicate installs, probably because some were installed with apt-get and then later multiple times with pip 1.5.6, what's the best way to check for duplicates and clean it up? I'm guessing it's not safe to use a script to pip uninstall all and re-install?
P.S. I wasn't sure whether I should post this as a new question or as a response to my original problem. Since this question is a lot more concise and general I felt it would be better separate. Apologies if I was mistaken.