Mac安装Tornado


在命令行下执行:

sudo easy_install setuptools pycurl

过程中可能会出错:

In file included from src/docstrings.c:4:
In file included from src/pycurl.h:4:
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 
      'stdio.h' file not found
#include 
         ^
1 error generated.
error: Setup script exited with error: command 'cc' failed with exit status 1

这是由于电脑中没有安装XCode Command Line Tools.

安装方法,在命令行中执行:

xcode-select --install

安装后,上边的错误消失了,但又有新的错误:

Using curl-config (libcurl 7.35.0)
In file included from src/docstrings.c:4:
In file included from src/pycurl.h:19:
In file included from /opt/local/include/curl/curl.h:35:
/opt/local/include/curl/curlrules.h:143:6: error: '__curl_rule_01__' declared as
      an array with a negative size
    [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/curl/curlrules.h:132:27: note: expanded from macro
      'CurlchkszEQ'
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
                          ^~~~~~~~~~~~~~~~~~~~~~~
/opt/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)];
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/curl/curlrules.h:132:27: note: expanded from macro
      'CurlchkszEQ'
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
                          ^~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
error: Setup script exited with error: command 'cc' failed with exit status 1


你可能感兴趣的:(Python)