我做了一个简单pip install psycopg2的mac系统.它安装正常,但当我尝试使用psycopg2时,我收到错误:
Reason: Incompatible library version: _psycopg.so requires version 1.0.0 or later, but libssl.0.9.8.dylib provides version 0.9.8
Run Code Online (Sandbox Code Playgroud)
pip freeze显示psycopg2==2.4.5恰到好处.我已经在几个virtualenvs上安装了psycopg2,但这是我第一次看到这样的错误.我尝试卸载并重新安装,结果相同.请帮忙
我在 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
Run Code Online (Sandbox Code Playgroud)
和
Failed building wheel for psycopg2
Run Code Online (Sandbox Code Playgroud)
和
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/
Run Code Online (Sandbox Code Playgroud)
尝试从源代码构建会导致类似的错误...
以前的研究和尝试的解决方案: …
尝试在MacOS 10.14.4上使用pip 19.1安装psycopg2会返回以下冗长的错误消息。我知道有些警告与gcc有关,但是鉴于实际的错误消息,我无法找到任何潜在问题的线索。
我尝试了以下操作,但没有任何运气:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages(是,我已经安装了某个文件,并且可以正常工作,不确定为什么要卸载)在pip和psycopg2周围似乎存在很多问题,但是我在Stackoverflow上发现的任何问题都没有显示类似的错误消息,也没有提供任何建议的修复程序。非常感谢任何指向潜在修复程序的提示!
pip install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/23/7e/93c325482c328619870b6cd09370f6dbe1148283daca65115cd63642e60f/psycopg2-2.8.2.tar.gz
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/y4/3pcgz9d54zj29hfq1lmlxpk80000gn/T/pip-install-ci93cz6u/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/y4/3pcgz9d54zj29hfq1lmlxpk80000gn/T/pip-record-ztnpuu7u/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/_json.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/extras.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/compat.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/errorcodes.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用python 3在OSX high sierra上的virtrualenv中安装mysqlclient,并得到以下错误:
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient, coverage, django-coverage-plugin, Pygments, babel, alabaster, sphinxcontrib-websupport, imagesize, pyparsing, packaging, snowballstemmer, MarkupSafe, Jinja2, docutils, Sphinx, typing, django-extensions, Werkzeug, django-test-plus, text-unidecode, python-dateutil, Faker, factory-boy, sqlparse, django-debug-toolbar, decorator, simplegeneric, wcwidth, prompt-toolkit, appnope, pickleshare, ptyprocess, pexpect, ipython-genutils, traitlets, parso, jedi, ipython, ipdb, py, pluggy, attrs, pytest, pytest-django, termcolor, pytest-sugar
Running setup.py install for mysqlclient ... error
Complete output from command /private/var/virtualenvs/todobackend/bin/python3.6 -u …Run Code Online (Sandbox Code Playgroud) macos ×3
postgresql ×3
pip ×2
psycopg2 ×2
python ×2
mysql ×1
python-3.5 ×1
python-3.x ×1
virtualenv ×1