求大佬解决下载psycopg2的问题

求大佬解决下载psycopg2的问题

问题描述:

服务器上装着python2和python3.

python2装了psycopg2,pip show可以看到,但是import失败,pip uninstall也不行显示

Cannot uninstall 'psycopg2'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

python3没有psycopg2,pip3 install显示

command 'gcc' failed with exit status 1

按照网上说的安装python3-devel也没卵用

 

这个包安装需要很多依赖,不但需要python-dev还需要gcc编译,如果感觉麻烦可尝试安装二进制版本

pip install psycopg2-binary