我正在尝试在 Ubuntu 12.04 机器上的 virtualenv 中安装 psycopg2。已安装所有相关软件包(python-dev、libpq-dev 等...)
当我在激活 virtualenv 的情况下运行 pip install psycopg2 时,我得到以下输出。这似乎是一个路径遍历问题。setup.cfg 显然在最顶部有一个 [build_ext] 部分,所以我认为 setup.py 没有找到正确的文件。有什么帮助吗?
Downloading/unpacking psycopg2
Running setup.py egg_info for package psycopg2
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/home/vagrant/outland_env/build/psycopg2/setup.py", line 459, in <module>
use_pydatetime = int(parser.get('build_ext', 'use_pydatetime'))
File "/home/vagrant/outland_env/local/lib/python2.7/site-packages/configparser.py", line 798, in get
d = self._unify_values(section, vars)
File "/home/vagrant/outland_env/local/lib/python2.7/site-packages/configparser.py", line 1154, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: 'build_ext'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/home/vagrant/outland_env/build/psycopg2/setup.py", line 459, in <module>
use_pydatetime = int(parser.get('build_ext', 'use_pydatetime'))
File "/home/vagrant/outland_env/local/lib/python2.7/site-packages/configparser.py", line 798, in get
d = self._unify_values(section, vars)
File "/home/vagrant/outland_env/local/lib/python2.7/site-packages/configparser.py", line 1154, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: 'build_ext'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/vagrant/outland_env/build/psycopg2
Storing complete log in /tmp/tmpoeLbaP