我正在尝试运行使用pycurl的代码,但是当我这样做时,我收到以下错误:
uilleann-pipes-160:data_collection Jim$ python xlsxDownloader.py
Traceback (most recent call last):
File "xlsxDownloader.py", line 21, in <module>
from import_hedgehogs import Link
File "/Users/Jim/Documents/Hedgehogs/hedgehogs/data_collection/import_hedgehogs.py", line 8, in <module>
import pycurl
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)
当我做&#34;哪个pycurl&#34;在终端中它没有输出所以我然后尝试使用&#34; pip install pycurl&#34;安装pycurl。但是,当我这样做时,我收到以下错误:
uilleann-pipes-160:data_collection Jim$ pip install pycurl
Collecting pycurl
Using cached pycurl-7.43.0.1.tar.gz
Installing collected packages: pycurl
Running setup.py install for pycurl ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-build-gqCefl/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-Vbtxf4-record/install-record.txt --single-version-externally-managed --compile:
Using curl-config (libcurl 7.54.0)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.13-intel-2.7
creating build/lib.macosx-10.13-intel-2.7/curl
copying python/curl/__init__.py -> build/lib.macosx-10.13-intel-2.7/curl
running build_ext
building 'pycurl' extension
creating build/temp.macosx-10.13-intel-2.7
creating build/temp.macosx-10.13-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.1" -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/docstrings.c -o build/temp.macosx-10.13-intel-2.7/src/docstrings.o
In file included from src/docstrings.c:4:
src/pycurl.h:164:13: fatal error: 'openssl/ssl.h' file not found
# include <openssl/ssl.h>
^~~~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-build-gqCefl/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-Vbtxf4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-build-gqCefl/pycurl/
答案 0 :(得分:0)
安装前两个软件包
sudo apt-get install libcurl4-openssl-dev
python -m pip install pybind11
这些是可选的
sudo apt install libgmp-dev libmpfr-dev libmpc-dev
sudo apt install libssl-dev
sudo apt-get install unixodbc unixodbc-dev