How to install pip on Ubuntu
Pip is a better alternative to Easy Install for installing Python packages. It is most "nutritious" when used with its companion virtualenv. For more information on pip and virtualenv see my blog post: Notes on using pip and virtualenv with Django.
Install pip and virtualenv for Ubuntu 10.10 Maverick and newer
$ sudo apt-get install python-pip python-dev build-essential
$ sudo pip install --upgrade pip
$ sudo pip install --upgrade virtualenv
For older versions of Ubuntu
- Install Easy Install
$ sudo apt-get install python-setuptools python-dev build-essential
- Install pip
$ sudo easy_install pip
- Install virtualenv
$ sudo pip install --upgrade virtualenv
Related posts
- How to use pip with crate.io — posted 2012-10-24
- How to install MySQLdb in a virtualenv on Ubuntu Karmic — posted 2010-02-15
- Using psycopg2 with virtualenv on Ubuntu
JauntyMaverick — posted 2009-07-31 - Notes on using pip and virtualenv with Django — posted 2009-05-06
- Installing Python 2.6 from source on Ubuntu Hardy — posted 2008-10-02
Comments
too bad the version in the ubuntu reps is old as hell
The next step should be:
$ pip install --upgrade pip
This also works on Debian Lenny :-)
Charles: Thanks. I updated the post to include upgrading pip.
Thanks a lot!
Thanks a lot!
Never do sudo easy_install or sudo pip on a package-based distribution! Use virtualenv only.
http://workaround.org/easy-install-debian
worked..gr8...thnx..!!!1
This tutorial really helped my to install pip on my Linux Mint distributions. Regards!
I am trying to install pip on ubuntu 10.10. But the mirror is dead, and I keep receiving errors, basically 404 as it fails to find required files. :( Is there anyway that I can install pip on my machine. As I need it to get pymongo ...
Works perfectly on my ubuntu, thank you!
Thanks for the clear, accurate notes.
Thanks for the article. I suggest getting rid of the $ prefixes to the lines because it prevents easy copy and paste to the command line.
thanks a lot!!!
disqus:1881724634
Your page is chill.
disqus:2003335954
hello how problem this message:
The directory '/home/otluiz/.cache/pip/http' or its parent directory is not owned by the current user
disqus:2331126422
Thanks a lot!
disqus:2601268748
Nice tutorial! Thanks for posting. Can you give me any tips for my Pip/Ubuntu tutorial? http://feenta.com/install-p...
It's actually the first Linux tutorial I've written.
disqus:2939687630
Thanks works fo me in Linux Mint 17.3 MATE 64-bit.
disqus:3293980571
Thank you! I linked this page on my blog. I have an article on installing pip3/Python3 on CentOS 6.x. https://www.savelono.com/li...
disqus:3338154713
Now I find best solution:
Ubuntu 16.04 with pip default for python 3.6
Install python3.6 (if not yet)
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
Install pip:
1. Install curl (curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.)
sudo apt-get install curl
2. Install pip:
curl https://bootstrap.pypa.io/g... | sudo python3.6
Check again: pip --version
disqus:3426410511