Python comes with a nice tool called easy_install that enables you to install additional packages as easy as:
easy_install <package_name>
If you are behind a HTTP proxy server, this might fail unless you specify the proxy URL in the environment variable HTTP_PROXY like this:
However, when you are sitting behind a firewall (like we at my company are), you might still not be able to download any packages from the python package repository. Here’s a quick guide how to circumvent the issue:
- Create a folder on your local machine that will contain all packages you have to download.
- Go to http://pypi.python.org/simple/ and download the package you want to install into your local folder.
- In the scripts directory of your python installation, call:
easy_install -H none -f d:\Backup\Programs\python-packages <package_name> - When you disallow all foreign hosts with “-H none”, easy_install will not be able to fetch any packages your package depends on, so you have to resolve all dependency errors by repeating step 1 – 3 for the missing package if easy_install gives you a message like this:
“No local packages or download links found for logilab-common>=0.49.0”
Another solution I found on the internet would be to install and use ASProxy, but I’m not going to try that for now.
See also: easy_install guide