Posts Tagged ‘pip’

update all packages with pip in your virtual environment

January 5, 2017 Leave a comment

You want to update all installed packages in your virtual environment.


$ pip install pip-review
$ pip-review --local --interactive

Tip from here.

Categories: python Tags: ,

python uninstall

November 2, 2014 Leave a comment

Sometimes you need to install a software with “python install“. However, if you want to get rid of it, there is no “python uninstall” or “python remove”. Stupid, but true.

I found the solution here. In short:

# install:
$ (sudo) python install

# uninstall:
# then remove with pip:
$ (sudo) pip uninstall PACKAGE_NAME
Categories: python Tags: , ,


January 25, 2014 Leave a comment

“A set of two command line tools (pip-review + pip-dump) to help you keep your pip-based packages fresh, even when you’ve pinned them.

pip-review checks PyPI and reports available updates. It uses the list of currently installed packages to check for updates, it does not use any requirements.txt.

pip-dump dumps the exact versions of installed packages in your active environment to your requirements.txt file.”

I haven’t used it yet, so this post a reminder for me. I think I will need it soon.

Categories: python Tags: ,

PyPy is awesome

August 15, 2013 Leave a comment

PyPy is a fast, compliant alternative implementation of the Python language (2.7.3 and 3.2.3).

Visit the download page and get the 32-bit or 64-bit archive, depending on your architecture. I extracted it in the /opt directory and put a symbolic link on it:

jabba@jabba-uplink:/opt$ ls -al | grep pypy
lrwxrwxrwx  1 jabba jabba     8 Aug 15 12:32 pypy -> pypy-2.1
drwxr-xr-x  7 jabba jabba  4096 Jul 31 12:59 pypy-2.1

If you install a newer version, just update the symbolic link.

Put another symbolic link to /usr/bin called pypy that points to /opt/pypy/bin/pypy:

root@jabba-uplink:~# ls -al /usr/bin/pypy
lrwxrwxrwx 1 root root 18 Aug 15 16:39 /usr/bin/pypy -> /opt/pypy/bin/pypy

Try it:

jabba@jabba-uplink:~$ pypy
Python 2.7.3 (480845e6b1dd, Jul 31 2013, 09:57:07)
[PyPy 2.1.0 with GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Install pip for pypy
We also want to use 3rd party libraries with pypy thus we need pip.

$ wget
$ wget
$ pypy
$ pypy

Add the following alias to your ~/.bashrc:

alias pip_pypy='/opt/pypy/bin/pip'

Open a new terminal and you are ready to install 3rd party libraries. Example:

$ pip_pypy install futures    # import concurrent.futures

Tip from here. Getting started here.

Categories: python Tags: ,

update all pip packages

You want to update all the pip-installed Python packages on your system.

At there is a very nice little script for this task:

import pip
from subprocess import call

for dist in pip.get_installed_distributions():
    call("pip install --upgrade " + dist.project_name, shell=True)

I modified it a bit to update packages in ascending order by name in an ignore-case way:

#!/usr/bin/env python

import os
import pip

dists = []
for dist in pip.get_installed_distributions():

for dist_name in sorted(dists, key=lambda s: s.lower()):
    cmd = "sudo pip install {0} -U".format(dist_name)
    print '#', cmd

I want to update the packages globally, that’s why the “sudo“. If you run it, it will just print the commands to the stdout (dry run). If everything is OK, uncomment the last line.

Update (20140121)
I made a github project of it:

Categories: python Tags: , ,

Install a package with pip from a github repository

December 27, 2012 Leave a comment

You want to install a package from a GitHub repository via pip.

Let’s take an example. Say you want to install requests whose github address is

With pip you can istall it like this:

sudo pip install -U
Categories: python Tags: ,

Install a package via pip even if PyPI is down

December 2, 2012 Leave a comment

PyPI is down but still, you want to install a package.

Use a mirror, e.g.

sudo pip install -i <package_name>
Categories: python Tags: , , , ,