This project is archived and is in readonly mode.

#128 ✓ invalid
akaihola

setup.py egg_info fails if development libraries are missing

Reported by akaihola | September 19th, 2012 @ 06:20 PM

I have a server where outbound HTTP traffic is intentionally prohibited. When deploying my web app, I'm downloading Python package dependencies on another host and rsyncing them up to the server.

If the PostgreSQL development libraries aren't present on the host, pip throws an exception when executing setup.py egg_info for psycopg2 and fails to download any remaining packages. The --no-deps option has no effect on this behavior.

Downloading packages on a different machine is probably a common use case for pip's --download. It would make sense for it to work even if development packages aren't installed on the dowloading machine.

As an example, let's assume a requirements.txt:

psycopg2
python-dateutil

If I now run:

$ pip install --download . -r requirements.txt

I get this:

Downloading/unpacking psycopg2 (from -r requirements.txt (line 1))
Saved ./psycopg2-2.4.5.tar.gz
Running setup.py egg_info for package psycopg2
  Error: You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
  Complete output from command python setup.py egg_info:
  running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Error: You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
----------------------------------------
Command python setup.py egg_info failed with error code 1 in build/psycopg2
Storing complete log in /home/akaihola/.pip/pip.log

In this case, the psycopg2 package is downloaded, but python-dateutils is not:

$ ls
psycopg2-2.4.5.tar.gz  requirements.txt

See https://github.com/pypa/pip/issues/661 for a discussion of this issue on the pip issue tracker.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

WARNING: the informations in this tracker are archived. Please submit new tickets or comments to the new tracker.


Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins

Tags

Pages