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
egg_info for psycopg2 and fails to download any remaining
--no-deps option has no effect on this
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
As an example, let's assume a requirements.txt:
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
- State changed from new to invalid
Closing the ticket: this is not our bug. Psycopg doesn't depend on setuptools, it depends on distutils. pip and easy_install work just fine on psycopg as long as external dependencies are available as explained in the docs (http://initd.org/psycopg/docs/install.html#install-from-source) and that's enough for us.
Feel free to provide patches if this improves what you think is broken, but adding a dependency on setuptools will not be accepted.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
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.