~/psycopg2-2.0.13$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.6
creating build/lib.linux-x86_64-2.6/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-2.6/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-2.6/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-2.6/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-2.6/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-2.6/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-2.6/psycopg2
copying lib/psycopg1.py -> build/lib.linux-x86_64-2.6/psycopg2
running build_ext
**error: No such file or directory**
或
$ sudo easy_install psycopg2==2.0.13
Searching for psycopg2==2.0.13
Reading http;//pypi.python.org/simple/psycopg2/
Reading http;//initd.org/projects/psycopg2
Reading http;//initd.org/pub/software/psycopg/
Best match: psycopg2 2.0.13
Downloading http;//initd.org/pub/software/psycopg/psycopg2-2.0.13.tar.gz
Processing psycopg2-2.0.13.tar.gz
Running psycopg2-2.0.13/setup.py -q bdist_egg --dist-dir /tmp/easy_install-QuViWt/psycopg2-2.0.13/egg-dist-tmp-P2W9Dh
error: Setup script exited with error: No such file or directory
答案 0 :(得分:2)
除了在Bubuntu上你总是可以从.deb包安装psycopg这一事实你可能缺少PostgreSQL开发头文件和pg_config命令。尝试安装libpq-dev,也可以安装一个postgresql-sever-dev-X.Y软件包。另外,psycopg 2.0.13已经很老了:使用新版本可以提供更好看的错误信息。