无法安装任何Python模块,可能是C编译器问题

时间:2014-02-07 05:13:33

标签: python gcc cython

我在安装/升级python模块时遇到很多问题。我是新手,所以请记住这一点。现在我尝试安装/卸载Xcode及其命令行工具。我尝试过gcc-osx,但是当我必须安装python模块时似乎没什么用。

Python有问题吗?我也想到了并下载了最新版本。我在Mac OSX Mavericks上,我使用过Xcode 5和Xcode 4似乎没什么用。问题是error: command 'gcc-4.2' failed with exit status 1吗?或者这是一个症状?请帮助我撕掉我的头发试图让它发挥作用。

编辑:好的,我解决了这个问题。我不得不完全删除python并重新安装它。现在模块编译!!!

以下只是一个例子:

pip install Cython --upgrade

Downloading/unpacking Cython from https://pypi.python.org/packages/source/C/Cython/Cython-0.20.tar.gz#md5=104f3bcdeb4969ba426a37376b4c0e7f
  Running setup.py egg_info for package Cython

    warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
    warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
    warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
    warning: no files found matching '*.pxd' under directory 'Cython/Utility'
Installing collected packages: Cython
  Found existing installation: Cython 0.16
    Uninstalling Cython:
      Successfully uninstalled Cython
  Running setup.py install for Cython
    building 'Cython.Plex.Scanners' extension
    gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c -o build/temp.macosx-10.6-intel-2.7/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.o
    In file included from /private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:16:
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:19:20: error: limits.h: No such file or directory
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:22:2: error: #error "Something's broken.  UCHAR_MAX should be defined in limits.h."
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:26:2: error: #error "Python's source code assumes C's unsigned char is an 8-bit type."
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:19: error: stdio.h: No such file or directory
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:35:5: error: #error "Python.h requires that stdio.h define NULL."
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:38:20: error: string.h: No such file or directory
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:40:19: error: errno.h: No such file or directory
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:42:20: error: stdlib.h: No such file or directory
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:44:20: error: unistd.h: No such file or directory
    /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:56:20: error: assert.h: No such file or directory

以后出现很多错误

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8151: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8151: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8151: error: ‘PyVarObject’ has no member named ‘ob_size’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c: In function ‘__Pyx_PyNumber_Int’:

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8174: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8174: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8178: error: ‘PyObject’ has no member named ‘ob_refcnt’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8178: warning: left-hand operand of comma expression has no effect

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8179: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8197: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8197: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8203: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8204: error: ‘PyObject’ has no member named ‘ob_refcnt’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8204: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c: At top level:

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8219: error: ‘__Pyx_PyIndex_AsSsize_t’ declared as function returning a function

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c: In function ‘__Pyx_PyIndex_AsSsize_t’:

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8223: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8226: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8244: error: lvalue required as left operand of assignment

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8245: error: ‘PyObject’ has no member named ‘ob_refcnt’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8245: error: ‘PyObject’ has no member named ‘ob_type’

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8246: warning: return makes integer from pointer without a cast

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c: At top level:

/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/Cython/Plex/Scanners.c:8248: error: expected ‘)’ before ‘ival’

lipo: can't figure out the architecture type of: /var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T//ccIW3gB4.out

error: command 'gcc-4.2' failed with exit status 1

----------------------------------------
  Rolling back uninstall of Cython
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-CTxWlg-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/cy/7qjrqmz96cdb_4chkp1lcv300000gn/T/pip-build-Mike/Cython 

0 个答案:

没有答案