“Failed building wheel for psycopg2” - MacOSX using virtualenv and pip

前端 未结 14 1506
囚心锁ツ
囚心锁ツ 2020-12-08 18:20

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

相关标签:
14条回答
  • 2020-12-08 18:51

    I had same problem and this appears to be a Mojave Issue, I was able to resolve with:

    sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
    
    0 讨论(0)
  • 2020-12-08 18:51

    On OS X, I was able to solve this by simply upgrading wheel before installing psycopg2:

    pip install --upgrade wheel
    
    0 讨论(0)
  • 2020-12-08 18:54

    I know you are asking for development environment but if you are deploying on server say, Heroku. Just add below line in the requirements.txt of your project.

    django-heroku==0.3.1

    As this package itself will install the required packages like psycopg2 on server deployment.So let the server(heroku) should take care of it.

    0 讨论(0)
  • 2020-12-08 18:59

    I had this issue on several packages, including psycopg2, numpy, and pandas. I simply removed the version from the requirements.txt file, and it worked.

    So instead of psycopg2-binary==2.7.6.1 I just had psycopg2-binary.

    0 讨论(0)
  • 2020-12-08 19:01

    I tried all the above solutions but they did not work for me. What I did was change the psycopg2 version in my requirements.txt file from psycopg2==2.7.4 to psycopg2==2.7.6

    0 讨论(0)
  • 2020-12-08 19:08

    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...

    0 讨论(0)
提交回复
热议问题