我的Python软件包有一个setup.py可以在Ubuntu Trusty上本地构建并在一个新的Vagrant Ubuntu Trusty VM上构建,当我像这样配置它时:
sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7
sudo -H pip install setuptools wheel virtualenv --upgrade
Run Code Online (Sandbox Code Playgroud)
但是当我在Travis CI Trusty Beta VM上做同样的事情时:
- sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken
- curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7
- sudo -H pip install setuptools wheel virtualenv --upgrade
Run Code Online (Sandbox Code Playgroud)
我明白了:
python2.7 setup.py bdist_wheel
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help …Run Code Online (Sandbox Code Playgroud) 我运行"sudo pip install psycopg2",我得到一堆看起来像的输出
cc -DNDEBUG -g -fwrapv -Os .....
.....
cc -DNDEBUG -g -fwrapv -Os .....
.....
Run Code Online (Sandbox Code Playgroud)
最后它说:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/bz/pvj1g9xj16d10pjjgbrfl3fw0000gn/T/pip_build_root/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bz/pvj1g9xj16d10pjjgbrfl3fw0000gn/T/pip-uE3thn-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/bz/pvj1g9xj16d10pjjgbrfl3fw0000gn/T/pip_build_root/psycopg2
Storing debug log for failure in /Users/Tyler/Library/Logs/pip.log …Run Code Online (Sandbox Code Playgroud) 我正在为我的一个讲座工作项目,我需要下载包psycopg2才能使用正在使用的postgresql数据库.不幸的是,当我尝试pip安装psycopg2时会弹出以下错误:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么会这样?是因为Sierra没有支持某些套餐吗?提前致谢!
我在 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)
尝试从源代码构建会导致类似的错误...
以前的研究和尝试的解决方案: …
python ×4
psycopg2 ×3
postgresql ×2
macos ×1
pip ×1
pypi ×1
python-3.5 ×1
setup.py ×1
travis-ci ×1