在Mac OS X 10.6.8上安装pycurl时出现问题

时间:2013-04-19 04:34:00

标签: python python-2.7 install libcurl pycurl

我正在开发一个使用eBay SDK模块的python项目(我有python 2.7):https://github.com/timotheus/ebaysdk-python

我能够安装ebaysdk,但在运行导入它的程序时遇到了麻烦:

Nicole-MacBook-Air:python nicole$ python ebayToHTML.py 
Traceback (most recent call last):
  File "ebayToHTML.py", line 2, in <module>
    from ebaysdk import finding 
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ebaysdk-0.1.7-py2.7.egg/ebaysdk/__init__.py", line 3, in <module>
    import yaml, pycurl, urllib
ImportError: No module named pycurl

在遇到这个问题之前,我必须安装yaml,这需要一些研究,但最终得到了解决。但是,现在我无法安装pycurl。我尝试了许多命令,例如sudo easy_install pycurlsudo pip install pycurl,以及另一个已发布的问题sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl==7.19.0

所有这些都会显示...undeclared个错误,这些错误似乎归结为以下信息:

src/pycurl.c:61:4: error: src/pycurl.c:61:4: error: #error "Need libcurl version 7.19.0 or greater to compile pycurl."

但似乎我有必要这个libcurl(前提是这是检查它的方法吗?):

Nicole-MacBook-Air:python nicole$  curl-config --version
libcurl 7.19.7

其他人似乎也有类似的问题:pycurl install :( already have min. libcurl version

...但是答案有点过头了,我没有运气试试其中一些给出的不同命令。

我不知道现在该怎么办;这只是一个Snow Leopard问题,如果只是升级我的操作系统会更好地避免(对不起,如果这是一个愚蠢的概括)?我对此并不是很了解,也不知道与这些依赖关系的争论是否值得。

编辑:以下是我使用sudo easy_install pycurl获得的漫长追溯:

Nicole-MacBook-Air:python nicole$ sudo easy_install pycurl
Searching for pycurl
Reading http://pypi.python.org/simple/pycurl/
Reading http://pycurl.sourceforge.net/
Reading http://pycurl.sourceforge.net/download/
Best match: pycurl 7.19.0
Downloading http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
Processing pycurl-7.19.0.tar.gz
Writing /tmp/easy_install-k4bkjB/pycurl-7.19.0/setup.cfg
Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-k4bkjB/pycurl-7.19.0/egg-dist-tmp-EB2TOP
Using curl-config (libcurl 7.19.7)
src/pycurl.c:61:4: error: src/pycurl.c:61:4: error: #error "Need libcurl version 7.19.0 or greater to compile pycurl."
src/pycurl.c:85:4: warning: #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 " "cause random crashes on SSL requests"
#error "Need libcurl version 7.19.0 or greater to compile pycurl."
src/pycurl.c:85:4: warning: #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 " "cause random crashes on SSL requests"
src/pycurl.c:1134: error: syntax error before ‘opensocket_callback’
src/pycurl.c:1134: error: syntax error before ‘curlsocktype’
src/pycurl.c: In function ‘opensocket_callback’:src/pycurl.c:1134: error: syntax error before ‘opensocket_callback’
src/pycurl.c:1134: error: syntax error before ‘curlsocktype’
src/pycurl.c: In function ‘opensocket_callback’:
src/pycurl.c:1142: error: ‘CURL_SOCKET_BAD’ undeclared (first use in this function)
src/pycurl.c:1142: error: (Each undeclared identifier is reported only once
src/pycurl.c:1142: error: for each function it appears in.)
src/pycurl.c:1144: error: ‘clientp’ undeclared (first use in this function)
src/pycurl.c:1148: error: ‘address’ undeclared (first use in this function)

src/pycurl.c:1142: error: ‘CURL_SOCKET_BAD’ undeclared (first use in this function)
src/pycurl.c:1142: error: (Each undeclared identifier is reported only once
src/pycurl.c:1142: error: for each function it appears in.)
src/pycurl.c:1144: error: ‘clientp’ undeclared (first use in this function)
src/pycurl.c:1148: error: ‘address’ undeclared (first use in this function)
src/pycurl.c: In function ‘do_curl_setopt’:
src/pycurl.c:1599: error: ‘CURLOPT_COOKIELIST’ undeclared (first use in this function)
src/pycurl.c:1623: error: ‘CURLOPT_FTP_ALTERNATIVE_TO_USER’ undeclared (first use in this function)
src/pycurl.c:1624: error: ‘CURLOPT_SSH_PUBLIC_KEYFILE’ undeclared (first use in this function)
src/pycurl.c:1625: error: ‘CURLOPT_SSH_PRIVATE_KEYFILE’ undeclared (first use in this function)
src/pycurl.c:1626: error: ‘CURLOPT_COPYPOSTFIELDS’ undeclared (first use in this function)
src/pycurl.c:1627: error: ‘CURLOPT_SSH_HOST_PUBLIC_KEY_MD5’ undeclared (first use in this function)
src/pycurl.c:1628: error: ‘CURLOPT_CRLFILE’ undeclared (first use in this function)
src/pycurl.c:1629: error: ‘CURLOPT_ISSUERCERT’ undeclared (first use in this function)
src/pycurl.c: In function ‘do_curl_setopt’:
src/pycurl.c:1599: error: ‘CURLOPT_COOKIELIST’ undeclared (first use in this function)
src/pycurl.c:1623: error: ‘CURLOPT_FTP_ALTERNATIVE_TO_USER’ undeclared (first use in this function)
src/pycurl.c:1624: error: ‘CURLOPT_SSH_PUBLIC_KEYFILE’ undeclared (first use in this function)
src/pycurl.c:1625: error: ‘CURLOPT_SSH_PRIVATE_KEYFILE’ undeclared (first use in this function)
src/pycurl.c:1626: error: ‘CURLOPT_COPYPOSTFIELDS’ undeclared (first use in this function)
src/pycurl.c:1627: error: ‘CURLOPT_SSH_HOST_PUBLIC_KEY_MD5’ undeclared (first use in this function)
src/pycurl.c:1628: error: ‘CURLOPT_CRLFILE’ undeclared (first use in this function)
src/pycurl.c:1629: error: ‘CURLOPT_ISSUERCERT’ undeclared (first use in this function)
src/pycurl.c:2020: error: nested functions are disabled, use -fnested-functions to re-enable
src/pycurl.c:2020: error: syntax error before ‘opensocket_cb’
src/pycurl.c:2071: error: ‘CURLOPT_OPENSOCKETFUNCTION’ undeclared (first use in this function)
src/pycurl.c:2075: error: ‘opensocket_cb’ undeclared (first use in this function)
src/pycurl.c:2076: error: ‘CURLOPT_OPENSOCKETDATA’ undeclared (first use in this function)
src/pycurl.c:2020: error: nested functions are disabled, use -fnested-functions to re-enable
src/pycurl.c:2020: error: syntax error before ‘opensocket_cb’
src/pycurl.c:2071: error: ‘CURLOPT_OPENSOCKETFUNCTION’ undeclared (first use in this function)
src/pycurl.c:2075: error: ‘opensocket_cb’ undeclared (first use in this function)
src/pycurl.c:2076: error: ‘CURLOPT_OPENSOCKETDATA’ undeclared (first use in this function)
src/pycurl.c: In function ‘do_curl_getinfo’:
src/pycurl.c:2159: error: ‘CURLINFO_LASTSOCKET’ undeclared (first use in this function)
src/pycurl.c:2174: error: ‘CURLINFO_FTP_ENTRY_PATH’ undeclared (first use in this function)
src/pycurl.c:2175: error: ‘CURLINFO_REDIRECT_URL’ undeclared (first use in this function)
src/pycurl.c:2176: error: ‘CURLINFO_PRIMARY_IP’ undeclared (first use in this function)
src/pycurl.c:2194: error: ‘CURLINFO_APPCONNECT_TIME’ undeclared (first use in this function)
src/pycurl.c:2218: error: ‘CURLINFO_COOKIELIST’ undeclared (first use in this function)
src/pycurl.c: At top level:
src/pycurl.c:2341: error: syntax error before ‘curl_socket_t’
src/pycurl.c: In function ‘multi_socket_callback’:
src/pycurl.c:2354: error: ‘userp’ undeclared (first use in this function)
src/pycurl.c:2355: error: ‘easy’ undeclared (first use in this function)
src/pycurl.c:2365: error: ‘socketp’ undeclared (first use in this function)
src/pycurl.c:2371: error: ‘what’ undeclared (first use in this function)
src/pycurl.c:2371: error: ‘s’ undeclared (first use in this function)
src/pycurl.c: In function ‘do_multi_setopt’:
src/pycurl.c:2452: error: ‘CURLMOPT_LASTENTRY’ undeclared (first use in this function)
src/pycurl.c:2461: error: ‘CURLMOPT_PIPELINING’ undeclared (first use in this function)
src/pycurl.c:2464: error: ‘CURLMOPT_MAXCONNECTS’ undeclared (first use in this function)
src/pycurl.c:2479: error: nested functions are disabled, use -fnested-functions to re-enable
src/pycurl.c:2479: error: syntax error before ‘t_cb’
src/pycurl.c:2480: error: nested functions are disabled, use -fnested-functions to re-enable
src/pycurl.c:2480: error: syntax error before ‘s_cb’
src/pycurl.c:2483: error: ‘CURLMOPT_SOCKETFUNCTION’ undeclared (first use in this function)
src/pycurl.c:2484: error: ‘s_cb’ undeclared (first use in this function)
src/pycurl.c:2485: error: ‘CURLMOPT_SOCKETDATA’ undeclared (first use in this function)
src/pycurl.c:2489: error: ‘CURLMOPT_TIMERFUNCTION’ undeclared (first use in this function)
src/pycurl.c:2490: error: ‘t_cb’ undeclared (first use in this function)
src/pycurl.c:2491: error: ‘CURLMOPT_TIMERDATA’ undeclared (first use in this function)
src/pycurl.c: In function ‘do_multi_assign’:
src/pycurl.c:2537: error: ‘curl_socket_t’ undeclared (first use in this function)
src/pycurl.c:2537: error: syntax error before ‘socket’
src/pycurl.c: In function ‘do_multi_socket_action’:
src/pycurl.c:2562: error: ‘curl_socket_t’ undeclared (first use in this function)
src/pycurl.c:2562: error: syntax error before ‘socket’
src/pycurl.c: In function ‘do_curl_getinfo’:
src/pycurl.c:2159: error: ‘CURLINFO_LASTSOCKET’ undeclared (first use in this function)
src/pycurl.c:2174: error: ‘CURLINFO_FTP_ENTRY_PATH’ undeclared (first use in this function)
src/pycurl.c:2175: error: ‘CURLINFO_REDIRECT_URL’ undeclared (first use in this function)
src/pycurl.c:2176: error: ‘CURLINFO_PRIMARY_IP’ undeclared (first use in this function)
src/pycurl.c:2194: error: ‘CURLINFO_APPCONNECT_TIME’ undeclared (first use in this function)
src/pycurl.c:2218: error: ‘CURLINFO_COOKIELIST’ undeclared (first use in this function)
src/pycurl.c: At top level:
src/pycurl.c:2341: error: syntax error before ‘curl_socket_t’
src/pycurl.c: In function ‘multi_socket_callback’:
src/pycurl.c:2354: error: ‘userp’ undeclared (first use in this function)
src/pycurl.c:2355: error: ‘easy’ undeclared (first use in this function)
src/pycurl.c:2365: error: ‘socketp’ undeclared (first use in this function)
src/pycurl.c:2371: error: ‘what’ undeclared (first use in this function)
src/pycurl.c:2371: error: ‘s’ undeclared (first use in this function)
src/pycurl.c: In function ‘do_multi_setopt’:
src/pycurl.c:2452: error: ‘CURLMOPT_LASTENTRY’ undeclared (first use in this function)
src/pycurl.c:2461: error: ‘CURLMOPT_PIPELINING’ undeclared (first use in this function)
src/pycurl.c:2464: error: ‘CURLMOPT_MAXCONNECTS’ undeclared (first use in this function)
src/pycurl.c:2479: error: nested functions are disabled, use -fnested-functions to re-enable
src/pycurl.c:2479: error: syntax error before ‘t_cb’
src/pycurl.c:2480: error: nested functions are disabled, use -fnested-functions to re-enable
src/pycurl.c:2480: error: syntax error before ‘s_cb’
src/pycurl.c:2483: error: ‘CURLMOPT_SOCKETFUNCTION’ undeclared (first use in this function)
src/pycurl.c:2484: error: ‘s_cb’ undeclared (first use in this function)
src/pycurl.c:2485: error: ‘CURLMOPT_SOCKETDATA’ undeclared (first use in this function)
src/pycurl.c:2489: error: ‘CURLMOPT_TIMERFUNCTION’ undeclared (first use in this function)
src/pycurl.c:2490: error: ‘t_cb’ undeclared (first use in this function)
src/pycurl.c:2491: error: ‘CURLMOPT_TIMERDATA’ undeclared (first use in this function)
src/pycurl.c: In function ‘do_multi_assign’:
src/pycurl.c:2537: error: ‘curl_socket_t’ undeclared (first use in this function)
src/pycurl.c:2537: error: syntax error before ‘socket’
src/pycurl.c: In function ‘do_multi_socket_action’:
src/pycurl.c:2562: error: ‘curl_socket_t’ undeclared (first use in this function)
src/pycurl.c:2562: error: syntax error before ‘socket’
src/pycurl.c: In function ‘initpycurl’:
src/pycurl.c:3546: error: ‘CURLE_TFTP_NOTFOUND’ undeclared (first use in this function)
src/pycurl.c:3547: error: ‘CURLE_TFTP_PERM’ undeclared (first use in this function)
src/pycurl.c:3548: error: ‘CURLE_TFTP_DISKFULL’ undeclared (first use in this function)
src/pycurl.c:3549: error: ‘CURLE_TFTP_ILLEGAL’ undeclared (first use in this function)
src/pycurl.c:3550: error: ‘CURLE_TFTP_UNKNOWNID’ undeclared (first use in this function)
src/pycurl.c:3551: error: ‘CURLE_TFTP_EXISTS’ undeclared (first use in this function)
src/pycurl.c:3552: error: ‘CURLE_TFTP_NOSUCHUSER’ undeclared (first use in this function)
src/pycurl.c:3553: error: ‘CURLE_CONV_FAILED’ undeclared (first use in this function)
src/pycurl.c:3554: error: ‘CURLE_CONV_REQD’ undeclared (first use in this function)
src/pycurl.c:3555: error: ‘CURLE_SSL_CACERT_BADFILE’ undeclared (first use in this function)
src/pycurl.c:3556: error: ‘CURLE_REMOTE_FILE_NOT_FOUND’ undeclared (first use in this function)
src/pycurl.c:3557: error: ‘CURLE_SSH’ undeclared (first use in this function)
src/pycurl.c:3558: error: ‘CURLE_SSL_SHUTDOWN_FAILED’ undeclared (first use in this function)
src/pycurl.c:3592: error: ‘CURLFTPMETHOD_DEFAULT’ undeclared (first use in this function)
src/pycurl.c:3593: error: ‘CURLFTPMETHOD_MULTICWD’ undeclared (first use in this function)
src/pycurl.c:3594: error: ‘CURLFTPMETHOD_NOCWD’ undeclared (first use in this function)
src/pycurl.c:3595: error: ‘CURLFTPMETHOD_SINGLECWD’ undeclared (first use in this function)
src/pycurl.c:3707: error: ‘CURLOPT_OPENSOCKETFUNCTION’ undeclared (first use in this function)
src/pycurl.c:3709: error: ‘CURLOPT_IGNORE_CONTENT_LENGTH’ undeclared (first use in this function)
src/pycurl.c:3710: error: ‘CURLOPT_COOKIELIST’ undeclared (first use in this function)
src/pycurl.c:3711: error: ‘CURLOPT_FTP_SKIP_PASV_IP’ undeclared (first use in this function)
src/pycurl.c:3712: error: ‘CURLOPT_FTP_FILEMETHOD’ undeclared (first use in this function)
src/pycurl.c:3713: error: ‘CURLOPT_CONNECT_ONLY’ undeclared (first use in this function)
src/pycurl.c:3714: error: ‘CURLOPT_LOCALPORT’ undeclared (first use in this function)
src/pycurl.c:3715: error: ‘CURLOPT_LOCALPORTRANGE’ undeclared (first use in this function)
src/pycurl.c:3716: error: ‘CURLOPT_FTP_ALTERNATIVE_TO_USER’ undeclared (first use in this function)
src/pycurl.c:3717: error: ‘CURLOPT_MAX_SEND_SPEED_LARGE’ undeclared (first use in this function)
src/pycurl.c:3718: error: ‘CURLOPT_MAX_RECV_SPEED_LARGE’ undeclared (first use in this function)
src/pycurl.c:3719: error: ‘CURLOPT_SSL_SESSIONID_CACHE’ undeclared (first use in this function)
src/pycurl.c:3720: error: ‘CURLOPT_SSH_AUTH_TYPES’ undeclared (first use in this function)
src/pycurl.c:3721: error: ‘CURLOPT_SSH_PUBLIC_KEYFILE’ undeclared (first use in this function)
src/pycurl.c:3722: error: ‘CURLOPT_SSH_PRIVATE_KEYFILE’ undeclared (first use in this function)
src/pycurl.c:3723: error: ‘CURLOPT_FTP_SSL_CCC’ undeclared (first use in this function)
src/pycurl.c:3724: error: ‘CURLOPT_TIMEOUT_MS’ undeclared (first use in this function)
src/pycurl.c:3725: error: ‘CURLOPT_CONNECTTIMEOUT_MS’ undeclared (first use in this function)
src/pycurl.c:3726: error: ‘CURLOPT_HTTP_TRANSFER_DECODING’ undeclared (first use in this function)
src/pycurl.c:3727: error: ‘CURLOPT_HTTP_CONTENT_DECODING’ undeclared (first use in this function)
src/pycurl.c:3728: error: ‘CURLOPT_NEW_FILE_PERMS’ undeclared (first use in this function)
src/pycurl.c:3729: error: ‘CURLOPT_NEW_DIRECTORY_PERMS’ undeclared (first use in this function)
src/pycurl.c:3730: error: ‘CURLOPT_POST301’ undeclared (first use in this function)
src/pycurl.c:3731: error: ‘CURLOPT_PROXY_TRANSFER_MODE’ undeclared (first use in this function)
src/pycurl.c:3732: error: ‘CURLOPT_COPYPOSTFIELDS’ undeclared (first use in this function)
src/pycurl.c:3733: error: ‘CURLOPT_SSH_HOST_PUBLIC_KEY_MD5’ undeclared (first use in this function)
src/pycurl.c:3735: error: ‘CURLOPT_CRLFILE’ undeclared (first use in this function)
src/pycurl.c:3736: error: ‘CURLOPT_ISSUERCERT’ undeclared (first use in this function)
src/pycurl.c:3737: error: ‘CURLOPT_ADDRESS_SCOPE’ undeclared (first use in this function)
src/pycurl.c:3739: error: ‘CURLMOPT_TIMERFUNCTION’ undeclared (first use in this function)
src/pycurl.c:3740: error: ‘CURLMOPT_SOCKETFUNCTION’ undeclared (first use in this function)
src/pycurl.c:3741: error: ‘CURLMOPT_PIPELINING’ undeclared (first use in this function)
src/pycurl.c:3742: error: ‘CURLMOPT_MAXCONNECTS’ undeclared (first use in this function)
src/pycurl.c:3773: error: ‘CURLSSH_AUTH_ANY’ undeclared (first use in this function)
src/pycurl.c:3774: error: ‘CURLSSH_AUTH_NONE’ undeclared (first use in this function)
src/pycurl.c:3775: error: ‘CURLSSH_AUTH_PUBLICKEY’ undeclared (first use in this function)
src/pycurl.c:3776: error: ‘CURLSSH_AUTH_PASSWORD’ undeclared (first use in this function)
src/pycurl.c:3777: error: ‘CURLSSH_AUTH_HOST’ undeclared (first use in this function)
src/pycurl.c:3778: error: ‘CURLSSH_AUTH_KEYBOARD’ undeclared (first use in this function)
src/pycurl.c:3779: error: ‘CURLSSH_AUTH_DEFAULT’ undeclared (first use in this function)
src/pycurl.c:3788: error: ‘CURLINFO_APPCONNECT_TIME’ undeclared (first use in this function)
src/pycurl.c:3804: error: ‘CURLINFO_REDIRECT_URL’ undeclared (first use in this function)
src/pycurl.c:3805: error: ‘CURLINFO_PRIMARY_IP’ undeclared (first use in this function)
src/pycurl.c:3812: error: ‘CURLINFO_COOKIELIST’ undeclared (first use in this function)
src/pycurl.c:3813: error: ‘CURLINFO_LASTSOCKET’ undeclared (first use in this function)
src/pycurl.c:3814: error: ‘CURLINFO_FTP_ENTRY_PATH’ undeclared (first use in this function)
src/pycurl.c:3825: error: ‘CURL_CSELECT_IN’ undeclared (first use in this function)
src/pycurl.c:3826: error: ‘CURL_CSELECT_OUT’ undeclared (first use in this function)
src/pycurl.c:3827: error: ‘CURL_CSELECT_ERR’ undeclared (first use in this function)
src/pycurl.c:3828: error: ‘CURL_SOCKET_TIMEOUT’ undeclared (first use in this function)
src/pycurl.c:3829: error: ‘CURL_POLL_NONE’ undeclared (first use in this function)
src/pycurl.c:3830: error: ‘CURL_POLL_IN’ undeclared (first use in this function)
src/pycurl.c:3831: error: ‘CURL_POLL_OUT’ undeclared (first use in this function)
src/pycurl.c:3832: error: ‘CURL_POLL_INOUT’ undeclared (first use in this function)
src/pycurl.c:3833: error: ‘CURL_POLL_REMOVE’ undeclared (first use in this function)
src/pycurl.c: In function ‘initpycurl’:
src/pycurl.c:3546: error: ‘CURLE_TFTP_NOTFOUND’ undeclared (first use in this function)
src/pycurl.c:3547: error: ‘CURLE_TFTP_PERM’ undeclared (first use in this function)
src/pycurl.c:3548: error: ‘CURLE_TFTP_DISKFULL’ undeclared (first use in this function)
src/pycurl.c:3549: error: ‘CURLE_TFTP_ILLEGAL’ undeclared (first use in this function)
src/pycurl.c:3550: error: ‘CURLE_TFTP_UNKNOWNID’ undeclared (first use in this function)
src/pycurl.c:3551: error: ‘CURLE_TFTP_EXISTS’ undeclared (first use in this function)
src/pycurl.c:3552: error: ‘CURLE_TFTP_NOSUCHUSER’ undeclared (first use in this function)
src/pycurl.c:3553: error: ‘CURLE_CONV_FAILED’ undeclared (first use in this function)
src/pycurl.c:3554: error: ‘CURLE_CONV_REQD’ undeclared (first use in this function)
src/pycurl.c:3555: error: ‘CURLE_SSL_CACERT_BADFILE’ undeclared (first use in this function)
src/pycurl.c:3556: error: ‘CURLE_REMOTE_FILE_NOT_FOUND’ undeclared (first use in this function)
src/pycurl.c:3557: error: ‘CURLE_SSH’ undeclared (first use in this function)
src/pycurl.c:3558: error: ‘CURLE_SSL_SHUTDOWN_FAILED’ undeclared (first use in this function)
src/pycurl.c:3592: error: ‘CURLFTPMETHOD_DEFAULT’ undeclared (first use in this function)
src/pycurl.c:3593: error: ‘CURLFTPMETHOD_MULTICWD’ undeclared (first use in this function)
src/pycurl.c:3594: error: ‘CURLFTPMETHOD_NOCWD’ undeclared (first use in this function)
src/pycurl.c:3595: error: ‘CURLFTPMETHOD_SINGLECWD’ undeclared (first use in this function)
src/pycurl.c:3707: error: ‘CURLOPT_OPENSOCKETFUNCTION’ undeclared (first use in this function)
src/pycurl.c:3709: error: ‘CURLOPT_IGNORE_CONTENT_LENGTH’ undeclared (first use in this function)
src/pycurl.c:3710: error: ‘CURLOPT_COOKIELIST’ undeclared (first use in this function)
src/pycurl.c:3711: error: ‘CURLOPT_FTP_SKIP_PASV_IP’ undeclared (first use in this function)
src/pycurl.c:3712: error: ‘CURLOPT_FTP_FILEMETHOD’ undeclared (first use in this function)
src/pycurl.c:3713: error: ‘CURLOPT_CONNECT_ONLY’ undeclared (first use in this function)
src/pycurl.c:3714: error: ‘CURLOPT_LOCALPORT’ undeclared (first use in this function)
src/pycurl.c:3715: error: ‘CURLOPT_LOCALPORTRANGE’ undeclared (first use in this function)
src/pycurl.c:3716: error: ‘CURLOPT_FTP_ALTERNATIVE_TO_USER’ undeclared (first use in this function)
src/pycurl.c:3717: error: ‘CURLOPT_MAX_SEND_SPEED_LARGE’ undeclared (first use in this function)
src/pycurl.c:3718: error: ‘CURLOPT_MAX_RECV_SPEED_LARGE’ undeclared (first use in this function)
src/pycurl.c:3719: error: ‘CURLOPT_SSL_SESSIONID_CACHE’ undeclared (first use in this function)
src/pycurl.c:3720: error: ‘CURLOPT_SSH_AUTH_TYPES’ undeclared (first use in this function)
src/pycurl.c:3721: error: ‘CURLOPT_SSH_PUBLIC_KEYFILE’ undeclared (first use in this function)
src/pycurl.c:3722: error: ‘CURLOPT_SSH_PRIVATE_KEYFILE’ undeclared (first use in this function)
src/pycurl.c:3723: error: ‘CURLOPT_FTP_SSL_CCC’ undeclared (first use in this function)
src/pycurl.c:3724: error: ‘CURLOPT_TIMEOUT_MS’ undeclared (first use in this function)
src/pycurl.c:3725: error: ‘CURLOPT_CONNECTTIMEOUT_MS’ undeclared (first use in this function)
src/pycurl.c:3726: error: ‘CURLOPT_HTTP_TRANSFER_DECODING’ undeclared (first use in this function)
src/pycurl.c:3727: error: ‘CURLOPT_HTTP_CONTENT_DECODING’ undeclared (first use in this function)
src/pycurl.c:3728: error: ‘CURLOPT_NEW_FILE_PERMS’ undeclared (first use in this function)
src/pycurl.c:3729: error: ‘CURLOPT_NEW_DIRECTORY_PERMS’ undeclared (first use in this function)
src/pycurl.c:3730: error: ‘CURLOPT_POST301’ undeclared (first use in this function)
src/pycurl.c:3731: error: ‘CURLOPT_PROXY_TRANSFER_MODE’ undeclared (first use in this function)
src/pycurl.c:3732: error: ‘CURLOPT_COPYPOSTFIELDS’ undeclared (first use in this function)
src/pycurl.c:3733: error: ‘CURLOPT_SSH_HOST_PUBLIC_KEY_MD5’ undeclared (first use in this function)
src/pycurl.c:3735: error: ‘CURLOPT_CRLFILE’ undeclared (first use in this function)
src/pycurl.c:3736: error: ‘CURLOPT_ISSUERCERT’ undeclared (first use in this function)
src/pycurl.c:3737: error: ‘CURLOPT_ADDRESS_SCOPE’ undeclared (first use in this function)
src/pycurl.c:3739: error: ‘CURLMOPT_TIMERFUNCTION’ undeclared (first use in this function)
src/pycurl.c:3740: error: ‘CURLMOPT_SOCKETFUNCTION’ undeclared (first use in this function)
src/pycurl.c:3741: error: ‘CURLMOPT_PIPELINING’ undeclared (first use in this function)
src/pycurl.c:3742: error: ‘CURLMOPT_MAXCONNECTS’ undeclared (first use in this function)
src/pycurl.c:3773: error: ‘CURLSSH_AUTH_ANY’ undeclared (first use in this function)
src/pycurl.c:3774: error: ‘CURLSSH_AUTH_NONE’ undeclared (first use in this function)
src/pycurl.c:3775: error: ‘CURLSSH_AUTH_PUBLICKEY’ undeclared (first use in this function)
src/pycurl.c:3776: error: ‘CURLSSH_AUTH_PASSWORD’ undeclared (first use in this function)
src/pycurl.c:3777: error: ‘CURLSSH_AUTH_HOST’ undeclared (first use in this function)
src/pycurl.c:3778: error: ‘CURLSSH_AUTH_KEYBOARD’ undeclared (first use in this function)
src/pycurl.c:3779: error: ‘CURLSSH_AUTH_DEFAULT’ undeclared (first use in this function)
src/pycurl.c:3788: error: ‘CURLINFO_APPCONNECT_TIME’ undeclared (first use in this function)
src/pycurl.c:3804: error: ‘CURLINFO_REDIRECT_URL’ undeclared (first use in this function)
src/pycurl.c:3805: error: ‘CURLINFO_PRIMARY_IP’ undeclared (first use in this function)
src/pycurl.c:3812: error: ‘CURLINFO_COOKIELIST’ undeclared (first use in this function)
src/pycurl.c:3813: error: ‘CURLINFO_LASTSOCKET’ undeclared (first use in this function)
src/pycurl.c:3814: error: ‘CURLINFO_FTP_ENTRY_PATH’ undeclared (first use in this function)
src/pycurl.c:3825: error: ‘CURL_CSELECT_IN’ undeclared (first use in this function)
src/pycurl.c:3826: error: ‘CURL_CSELECT_OUT’ undeclared (first use in this function)
src/pycurl.c:3827: error: ‘CURL_CSELECT_ERR’ undeclared (first use in this function)
src/pycurl.c:3828: error: ‘CURL_SOCKET_TIMEOUT’ undeclared (first use in this function)
src/pycurl.c:3829: error: ‘CURL_POLL_NONE’ undeclared (first use in this function)
src/pycurl.c:3830: error: ‘CURL_POLL_IN’ undeclared (first use in this function)
src/pycurl.c:3831: error: ‘CURL_POLL_OUT’ undeclared (first use in this function)
src/pycurl.c:3832: error: ‘CURL_POLL_INOUT’ undeclared (first use in this function)
src/pycurl.c:3833: error: ‘CURL_POLL_REMOVE’ undeclared (first use in this function)
lipo: can't figure out the architecture type of: /var/tmp//cc1gGI6G.out
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1

如果它有帮助,这也是这个。它说它找不到它,仅此而已:(:

Nicole-MacBook-Air:python nicole$ sudo port install py27-curl
Error: Port py27-curl not found

编辑2:最后,我认为成功安装了pycurl:

Nicole-MacBook-Air:python nicole$ sudo port install py27-curl
Password:
--->  Computing dependencies for py27-curl
--->  Dependencies to be installed: curl curl-ca-bundle
--->  Fetching archive for curl-ca-bundle
--->  Attempting to fetch curl-ca-bundle-7.30.0_0.darwin_10.noarch.tbz2 from http://packages.macports.org/curl-ca-bundle
--->  Attempting to fetch curl-ca-bundle-7.30.0_0.darwin_10.noarch.tbz2.rmd160 from http://packages.macports.org/curl-ca-bundle
--->  Installing curl-ca-bundle @7.30.0_0
--->  Activating curl-ca-bundle @7.30.0_0
--->  Cleaning curl-ca-bundle
--->  Fetching archive for curl
--->  Attempting to fetch curl-7.30.0_0+ssl.darwin_10.x86_64.tbz2 from http://packages.macports.org/curl
--->  Attempting to fetch curl-7.30.0_0+ssl.darwin_10.x86_64.tbz2.rmd160 from http://packages.macports.org/curl
--->  Installing curl @7.30.0_0+ssl
--->  Activating curl @7.30.0_0+ssl
--->  Cleaning curl
--->  Fetching archive for py27-curl
--->  Attempting to fetch py27-curl-7.19.0_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/py27-curl
--->  Attempting to fetch py27-curl-7.19.0_0.darwin_10.x86_64.tbz2.rmd160 from http://packages.macports.org/py27-curl
--->  Installing py27-curl @7.19.0_0
--->  Activating py27-curl @7.19.0_0
--->  Cleaning py27-curl
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

但是接下来! :

Nicole-MacBook-Air:python nicole$ python
Python 2.7.4 (v2.7.4:026ee0057e2d, Apr  6 2013, 10:15:50) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pycurl

这里发生了什么?

3 个答案:

答案 0 :(得分:1)

您可能有两个python安装,一个在/ usr / bin / python中附带MacBookPro,另一个默认为macports到/ opt / local / bin / python。

如果有效,请尝试此操作:

sudo port install py27-yaml
sudo port install py27-curl
/opt/local/bin/python2.7
import pycurl

答案 1 :(得分:0)

<{1>}在pycurl安装easy_install时我遇到了here发布的错误,所以我尝试了macports ... 10.6.8 ..和。它已成功安装并正常工作::

Namit-Kewats-MacBook:~ namitkewat$ sudo port install py27-curl
Warning: port definitions are more than two weeks old, consider using selfupdate
--->  Computing dependencies for py27-curl
--->  Fetching archive for py27-curl
--->  Attempting to fetch py27-curl-7.19.0_0.darwin_10.x86_64.tbz2 from http://lil.fr.packages.macports.org/py27-curl
--->  Attempting to fetch py27-curl-7.19.0_0.darwin_10.x86_64.tbz2.rmd160 from http://lil.fr.packages.macports.org/py27-curl
--->  Installing py27-curl @7.19.0_0
--->  Activating py27-curl @7.19.0_0
--->  Cleaning py27-curl
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.
Namit-Kewats-MacBook:~ namitkewat$ python
Python 2.7.3 (default, Oct 22 2012, 06:12:28) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl
>>>

使用macports安装yaml非常简单,只需在终端中运行sudo port install py27-yaml ..

答案 2 :(得分:0)

这对OSX 10.8.3起作用,后者来自pycurl文档

sudo python setup.py install --with-ssl --curl-config=/usr/bin/curl-config