“Psycopg2的建筑轮胎失败” - MacOSX使用virtualenv和pip [英] "Failed building wheel for psycopg2" - MacOSX using virtualenv and pip
问题描述
我试图与其他几个人建立网站,并尝试使用Django / Python / VirtualEnv时遇到了一个奇怪的错误。我已经找到了解决这个问题的其他操作系统,如Ubuntu,但找不到任何好的解决方案的Mac。
这是正在运行的相关代码:
virtualenv -p python3 venv
source venv / bin / activate
pip install -r requirements.txt
运行该块后,我收到以下错误:
AssertionError
django-toolbelt
运行setup.py bdist_wheel为psycopg2
...
AssertionError
无法构建psycopg2
无法构建django-toolbelt psycopg2
我相信我已经安装django-toolbelt和psycopg2,所以我不知道为什么会失败。
我可以想到的唯一区别是我没有使用命令
sudo apt-get install libpq-dev
按照Ubuntu的使用指示,用brew安装postgresql照顾了标题。
感谢任何帮助或见解!
我在Arch linux上也有同样的问题。我认为这不是一个操作系统依赖的问题。无论如何,我通过找到过时的包和更新来解决这个问题。
pip uninstall psycopg2
pip list --outdated
pip install --upgrade wheel
点安装 - 升级setuptools
点安装psycopg2
希望这有助于...
I'm attempting to make a website with a few others for the first time, and have run into a weird error when trying to use Django/Python/VirtualEnv. I've found solutions to this problem for other operating systems, such as Ubuntu, but can't find any good solutions for Mac.
This is the relevant code being run:
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
After running that block, I get the following errors:
AssertionError
Failed building wheel for django-toolbelt Running setup.py bdist_wheel for psycopg2
...
AssertionError
Failed building wheel for psycopg2 Failed to build django-toolbelt psycopg2
I believe I've installed the "django-toolbelt" and "psycopg2", so I'm not sure why it would be failing.
The only difference I can think of is that I did not use the command
sudo apt-get install libpq-dev
as was instructed for Ubuntu usage as I believe that installing postgresql with brew took care of the header.
Thanks for any help or insight!
I had the same problem on Arch linux. I think that it's not an OS dependant problem. Anyway, I fixed this by finding the outdated packages and updating then.
pip uninstall psycopg2
pip list --outdated
pip install --upgrade wheel
pip install --upgrade setuptools
pip install psycopg2
hope this helps...
这篇关于“Psycopg2的建筑轮胎失败” - MacOSX使用virtualenv和pip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!