0

我正在开发一个使用此处找到的 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 pycurl,sudo 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 :( 已经有 min.libcurl 版本

...但是答案有点超出我的想象,我没有运气尝试其中一些给出的不同命令。

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

编辑:这是我得到的长追溯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

这里发生了什么?

4

3 回答 3

2

你可能有两个 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
于 2013-04-23T19:33:05.700 回答
0

在安装pycurleasy_install我遇到了这里发布的错误,所以我尝试了 macports .. .on 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
>>>

yaml使用 macports 也很容易安装,只需sudo port install py27-yaml在终端中运行...

于 2013-04-19T14:05:44.010 回答
0

这在 OSX 10.8.3 上对我有用,这与 pycurl 文档相反

sudo python setup.py install --with-ssl --curl-config=/usr/bin/curl-config
于 2014-07-11T01:30:08.517 回答