wiki:ExternalPythonPackages

Version 2 (modified by maphew, 13 years ago) ( diff )

installing and using pip

External Python Packages

There are any number of python programs which people would like to use with Osgeo4W, but for which there isn't an available package maintainer to create an o4w-specific version. Here are two recipes for installing 3rd party python apps which aren't part of the osgeo4w ecosystem.

Important note: it's up to you to ensure the 3rd party packages can play nice with osgeo4w. If things get too messed up because of conflicting versions or something you may need to remove everything and install from scratch.

pip

pip is a tool for installing and managing Python packages, such as those found in the Python Package Index. It’s a replacement for easy_install.

If you don't have it already, install pkg-curl, then from the Osgeo4w shell:

Install the distribute prerequisite and then pip:

curl http://python-distribute.org/distribute_setup.py | python
curl --insecure https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python

rem Create a batch file to run pip:
copy con %osgeo4w_root%\bin\pip.bat
%pythonhome%\Scripts\pip.exe %*[ctrl-Z]

(recipe adapted from pip install instructions)

Now you can install (or remove) what you're really after:

rem ipython - Productive Interactive Computing, a great python shell
pip install ipython
pip uninstall foobar

See usage for more possibilities, like installing from a source code repository.

It's a good idea to run from a temp or scratch directory because a failed build will leave files behind (and a great many of the packages fail).

Note: See TracWiki for help on using the wiki.