在Mac OS X 10.6.8上安装pycurl有困难。

时间:2022-09-19 07:45:14

I am working on a python project (I have python 2.7) that uses the eBay SDK module found here: https://github.com/timotheus/ebaysdk-python

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

I was able to install ebaysdk but had trouble when running my program that imports it:

我可以安装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

Before running into this issue, I had to install yaml, which took a little research but eventually worked out. Now, though, I cannot get pycurl to install. I have tried a number of commands such as sudo easy_install pycurl, sudo pip install pycurl, and, from another posted question, sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl==7.19.0.

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

All of these give a huge display of ...undeclared errors, which seem to come down to the following message:

所有这些都显示了……未声明的错误,似乎可以归结为以下信息:

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:61:4:错误:src / pycurl。c:61:4: error: #error“需要libcurl版本7.19.0或更高版本才能编译pycurl。”

But it seems that I have this libcurl as necessary (provided this is the way to check for it?):

但似乎我有这个libcurl(假设这是检查它的方法):

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

Someone else seemed to have a similar issue here: pycurl install :( already have min. libcurl version

另一些人似乎也有类似的问题:pycurl安装:(已经有了min. libcurl版本)

...but the answers are a little over my head and I haven't had any luck trying out the different commands given in some of them.

…但是这些答案在我的脑海里有点模糊,我还没试过其中一些给出的不同命令。

I'm not sure what to do now; is this just a Snow Leopard issue that would be better avoided by (sorry if this is a dumb generalization) just upgrading my OS? I am not very knowledgeable on this and don't know if wrangling with these dependencies will be worth it.

我不知道现在该怎么办;这仅仅是一个雪豹问题,仅仅升级我的操作系统就可以更好地避免(如果这是一个愚蠢的概括的话,抱歉)吗?我在这方面不是很了解,也不知道与这些依赖关系争吵是否值得。

EDIT: Here is the long traceback I get with sudo easy_install pycurl:

编辑:这里是我从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

In case it helps, here is this, too. It says it cannot find it, and nothing more :( :

如果有用的话,这里也有。它说它找不到它,仅此而已:

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

EDIT 2: Finally, I supposedly installed pycurl successfully:

编辑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.

But then this! :

但后来这个!:

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

What is going on here?

这是怎么回事?

3 个解决方案

#1


1  

You possibly have two python installations, one that comes with MacBookPro in /usr/bin/python and the other defaulted by macports to /opt/local/bin/python.

您可能有两个python安装,一个安装在/usr/bin/python中,另一个安装在macports to /opt/local/bin/python中。

Try this if this works:

如果这个方法有效,试试这个:

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

#2


0  

while installing pycurl with easy_install i have faced the error which is posted here, so i have tried macports.. .on 10.6.8.. .and it has been installed successfully and working::

在使用easy_install安装pycurl时,我遇到了这里发布的错误,所以我尝试了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
>>>

Also to install yaml is very easy with macports, just run sudo port install py27-yaml in your terminal.. .

使用macports安装yaml也很容易,只需在终端上运行sudo端口安装py27-yaml。

#3


0  

This worked for me on OSX 10.8.3, which is backwards from the pycurl documentation

这在OSX 10.8.3上对我起了作用,这与pycurl文档相反

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

#1


1  

You possibly have two python installations, one that comes with MacBookPro in /usr/bin/python and the other defaulted by macports to /opt/local/bin/python.

您可能有两个python安装,一个安装在/usr/bin/python中,另一个安装在macports to /opt/local/bin/python中。

Try this if this works:

如果这个方法有效,试试这个:

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

#2


0  

while installing pycurl with easy_install i have faced the error which is posted here, so i have tried macports.. .on 10.6.8.. .and it has been installed successfully and working::

在使用easy_install安装pycurl时,我遇到了这里发布的错误,所以我尝试了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
>>>

Also to install yaml is very easy with macports, just run sudo port install py27-yaml in your terminal.. .

使用macports安装yaml也很容易,只需在终端上运行sudo端口安装py27-yaml。

#3


0  

This worked for me on OSX 10.8.3, which is backwards from the pycurl documentation

这在OSX 10.8.3上对我起了作用,这与pycurl文档相反

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