我在OSX中安装psycopg2时遇到严重麻烦。使用自制软件安装Postgresql 9.5.4_1后,我尝试在虚拟环境中安装psycopg2:pip install psycopg2
我还使用以下方式将pg_config添加到了我的路径中 PATH=$PATH:/usr/local/Cellar/postgresql/9.5.4_1/bin/pg_config
执行后,我收到许多错误,包括:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
和
Failed building wheel for psycopg2
和
Command "/Users/*username*/.virtualenvs/report/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/9p/3_wdgjzd03d6bw1p_c9rrt6c0000gp/T/pip-build-cuplxne2/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/9p/3_wdgjzd03d6bw1p_c9rrt6c0000gp/T/pip-8gbk007q-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/*username*/.virtualenvs/report/bin/../include/site/python3.5/psycopg2" failed with error code 1 in /private/var/folders/9p/3_wdgjzd03d6bw1p_c9rrt6c0000gp/T/pip-build-cuplxne2/psycopg2/
尝试从源代码构建会导致类似错误...
先前的研究和尝试的解决方案:
“ psycopg2的构建轮子失败”-使用virtualenv和pip的MacOSX
未在开发系统上安装PostgreSQL时将psycopg2安装到virtualenv中
无法在Mac OS X 10.7上的virtualenv中使用pip安装psycopg2
多谢您提供的协助!
这似乎是Homebrew为OSX sierra更新的一个问题。我终于可以通过使用自制软件卸载并重新安装python 3.5和postgresql,然后尝试再次安装psycopg2来解决此问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句