A lot of Python packages are only available as source code.
To install such a Python package, use its
$ sudo python setup.py install
This will install the Python files to a central location such as
/usr/local/lib. If you do not have such permissions or want to install to a user-local location then try this:
Create a directory, say
/home/joe/python_libs/lib/python in your home directory to host local Python packages.
Set the above path in the
PYTHONPATH environment variable.
Install the package by passing the above path to the
$ python setup.py install --home /home/joe/python_libs
To uninstall a package is tricky.
One solution is to find out where the files were installed and then use that list to remove those files:
$ sudo python setup.py install --record install-files.txt $ cat install-files.txt | sudo xargs rm -rf
Another solution is to just locate the installation directory, like
/usr/local/lib/python2.7/dist-packages for example and delete the directory of the package.
Tried with: Python 2.7.6 and Ubuntu 14.04