python - 无法在 Mac OS X 上安装 pycurl - 出现错误 1 ​​和 2

标签 python macos curl libcurl pycurl

我正在尝试在我的 Mac OSX 10.8.4 上安装 pycurl-7.19.0。

编译时出现的错误:

py setup.py install

结果:

Using curl-config (libcurl 7.24.0)
running install
running build
running build_py
running build_ext
building 'pycurl' extension
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-      aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/pycurl.c -o build/temp.macosx-10.8-intel-2.7/src/pycurl.o
clang: warning: argument unused during compilation: '-mno-fused-madd'
In file included from src/pycurl.c:50:
In file included from /usr/local/include/curl/curl.h:35:
/usr/local/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/include/curl/curlrules.h:132:27: note: expanded from macro 'CurlchkszEQ'
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
                      ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/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/include/curl/curlrules.h:132:27: note: expanded from macro 'CurlchkszEQ'
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
                      ^~~~~~~~~~~~~~~~~~~~~~~
src/pycurl.c:85:4: 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"
  [-W#warnings]
#  warning \
^
1 warning and 2 errors generated.
error: command 'clang' failed with exit status 1

我目前安装了 curl-7.32.0 并正在运行 Python 2.7.2 和 GCC 4.2.1。

最佳答案

这适用于 OSX 10.9

sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl==7.19.0

关于python - 无法在 Mac OS X 上安装 pycurl - 出现错误 1 ​​和 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18752405/

相关文章:

python - 每次编辑静态文件时都需要 manage.py collectstatic 吗?

objective-c - launchd:Mach 服务查找失败

java - 在 Dropwizard 中使用 Curl 命令实现 Restful Webservices Post 请求

VM 中的 Linux -curl 无法下载 nvm 文件?

python - 如何根据前两个匹配列从多个大型文本文件的第三列中提取数据?

python - django - 夹层 - 静态文件 - 令人沮丧的错误

python - 系统 python 与用户 python

macos - 错误: gcloud crashed (AttributeError): 'Thread' object has no attribute 'isAlive'

macos - 回调中 AudioQueue 缓冲区为空

php - 如何通过curl传递包含特殊字符的数据