如何在MacOSX 10.11.6上构建pycurl而不会出错



我试图在没有成功的情况下与libcurl(7.53.1(版本建立pycurl。

我在MacOSX El Capitan v10.11.6上。

我什至不确定我是否与OpenSSL保持一致。我可能需要确保正确安装OpenSSL并使用OpenSSL构建卷发。最后,用适当的卷发制成pycurl。

我一直在网上遵循几条曲目,但它们都没有让我到达我需要去的地方。

解决此构建问题的最佳选择是什么?

日志:

users-MBP-2:~ mickael$ sudo easy_install pycurl 
Password:
Searching for pycurl
Reading https://pypi.python.org/simple/pycurl/ Best match: pycurl 7.43.0
Downloading https://pypi.python.org/packages/12/3f/557356b60d8e59a1cce62ffc07ecc03e4f8a202c86adae34d8958262 81fb/pycurl-7.43.0.tar.gz#md5=c94bdba01da6004fa38325e9bd6b9760
Processing pycurl-7.43.0.tar.gz
Writing /tmp/easy_install-tmm5sV/pycurl-7.43.0/setup.cfg
Running pycurl-7.43.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-tmm5sV/pycurl-7.43.0/egg-dist- tmp-Yj_ArM
Using curl-config (libcurl 7.53.1)
warning: no files found matching 'src/Makefile'
In file included from src/docstrings.c:4:
In file included from src/pycurl.h:32:
In file included from /usr/local/Cellar/curl/7.53.1/include/curl/curl.h:39: /usr/local/Cellar/curl/7.53.1/include/curl/curlrules.h:143:6: error: '__curl_rule_01__' declared as an array with a negative
size
[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/Cellar/curl/7.53.1/include/curl/curlrules.h:132:27: note: expanded from macro 'CurlchkszEQ' #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/curl/7.53.1/include/curl/curlrules.h:153:6: error: '__curl_rule_02__' declared as an array with a negative
size
[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/Cellar/curl/7.53.1/include/curl/curlrules.h:132:27: note: expanded from macro 'CurlchkszEQ' #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
^~~~~~~~~~~~~~~~~~~~~~~ In file included from src/docstrings.c:4:
src/pycurl.h:190:5: warning: "libcurl was compiled with SSL support, but configure could not determine
which " "library was
used; thus no SSL crypto locking callbacks will be set, which may "
requests" [-W#warnings]
# warning  ^
1 warning and 2 errors generated.
error: Setup script exited with error: command 'cc' failed with exit status 1
"cause random crashes on SSL

好吧,构建pycurl肯定有一些挑战。这是我采取的步骤:

  1. 确保安装了OpenSSL(如果不使用啤酒:brew install openssl(。

  2. 用openssl重建卷曲,请记住curl不是用openssl构建的MacOSX/El Capitan上的OpenSSL,而是使用Securetransport。(尝试:Brew Install-Force Curl -with-Openssl(

  3. 用" pip"重建pycurl。我在PIP上取得了成功,但没有Easy_install。(尝试:sudo env cragflags =" - Arch x86_64" ldflags =" - l/usr/local/local/opt/openssl/lib" pip安装pycurl(

pycurl安装在:/library/python/2.7/site-packages/pycurl.so

安装的版本是:Pycurl-7.43.0

最新更新