我无法安装psycopg2。我尝试将数据库从sqlite更改为postgesql,但始终得到相同的错误。我也尝试通过项目解释器而不是终端安装它,但是得到了:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
(venv) localhost:mysite Sergio$ pip install psycopg2
bash: /Users/Sergio/PycharmProjects/#WE_GRAPPLE/venv/bin/pip: /Users/Sergio/PycharmProjects/#WE_GRAPPLE/venv/bin/python: bad interpreter: Permission denied
(venv) localhost:mysite Sergio$
答案 0 :(得分:0)
请确保您具有pip权限,您可以更改为root
su root
输入您的root密码,然后
pip install psycopg2