I'm trying to install pip
and virtualenv
on a server (running Ubuntu 12.04.4 LTS) on which I have access, but I can only do it with sudo apt-get install
(school politics). The problem is that althought I have run the sudo apt-get update
command to update the packages list, I think it keeps installing old ones. After doing sudo apt-get install python-pip python-virtualenv
, I do pip --version
on which I get the 1.0
, and virtualenv --version
on which I get 1.7.1.2
. These two version are quite old (pip
is already in 1.5.5
and virtualenv
in 1.11.5
). I read that the problem is that the packages list is not up-to-date, but the command sudo apt-get update
should solve this, but I guess no. How can I solve this? Thanks a lot!
apt-get update
updates packages from Ubuntu package catalog, which has nothing to do with mainstream versions.
LTS
in Ubuntu stands for Long Term Support. Which means that after a certain period in time they will only release security-related bugfixes to the packages. In general, major version of packages will not change inside of a major Ubuntu release, to make sure backwards-compatibility is kept.
So if then only thing you can do is apt-get update
, you have 2 options:
.deb
format and install.If you really need to use the latest stable versions of Python packages, then do not use apt-get
for installing Python packages and use pip instead. If you would use apt-get
and later install the same packages by means of pip
or (better not) easy_install
or setup.py
, you are likely to run into version conflicts wondering, why your python based commands are of unexpected versions, or even worse, why they do not work at all.
I try to follow this pattern:
Using instructions from here: http://pip.readthedocs.org/en/latest/installing.html find get-pip.py
script, download it and run as python script.
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py
$ rm get-pip.py
virtualenv
system widethis shall be as easy as:
$ sudo pip install virtualenv
$ sudo pip install virtualenvwrapper
and follow instructions for configuring it.
This shall prevent conflicts between various versions of packages.
You are free to update particular virtualenvs as you need one by one independently.
There are method how to speed up repeated installation of packages, what comes handy if you get used using virtualenv often. For details see my answer: https://stackoverflow.com/a/18520729/346478
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With