我正在尝试从pypi安装以下python包(os:centos6.6):
pip install -i https://pypi.python.org/pypi pymssql
pip install -i https://pypi.python.org/pypi pyodbc
pip install -i https://pypi.python.org/pypi PySide
但是没有一个安装工作,它们似乎都有一个共同的问题。让我们逐个看一下每个错误:
让我们从pymssql开始:
[root@8e6379e8595f /]# pip install pymssql
Collecting pymssql
Downloading http://mypiprepo-au/mypiprepo/pymssql/pymssql-2.1.1.zip (2.3MB)
100% |ââââââââââââââââââââââââââââââââ| 2.3MB 13.2MB/s
Installing collected packages: pymssql
Running setup.py install for pymssql ... error
Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Msb2ws/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Me_cOI-record/install-record.txt --single-version-externally-managed --compile:
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('64bit', '')
setup.py: platform.linux_distribution() => ('CentOS', '6.6', 'Final')
setup.py: platform.libc_ver() => ('glibc', '2.3')
setup.py: Using bundled FreeTDS in /tmp/pip-build-Msb2ws/pymssql/freetds/nix_64
setup.py: include_dirs = ['/tmp/pip-build-Msb2ws/pymssql/freetds/nix_64/include', '/usr/local/include']
setup.py: library_dirs = ['/tmp/pip-build-Msb2ws/pymssql/freetds/nix_64/lib', '/usr/local/lib']
running install
running build
running build_ext
cythoning _mssql.pyx to _mssql.c
Error compiling Cython file:
------------------------------------------------------------
...
return uuid.UUID(bytes_le=(<char *>data)[:length])
else:
return (<char *>data)[:length]
cdef int convert_python_value(self, object value, BYTE **dbValue,
^
------------------------------------------------------------
_mssql.pyx:821:9: Signature not compatible with previous declaration
Error compiling Cython file:
------------------------------------------------------------
...
cdef object msghandler
cpdef cancel(self)
cdef void clear_metadata(self)
cdef object convert_db_value(self, BYTE *, int, int)
cdef int convert_python_value(self, object value, BYTE **, int*, int*) except -1
^
------------------------------------------------------------
_mssql.pxd:38:33: Previous declaration is here
building '_mssql' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-build-Msb2ws/pymssql/freetds/nix_64/include -I/usr/local/include -I/usr/local/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB
_mssql.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Msb2ws/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Me_cOI-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Msb2ws/pymssql
pyodbc:
Step 13 : RUN pip install -i https://pypi.python.org/pypi pyodbc
---> Running in bce137040567
Collecting pyodbc
Downloading pyodbc-3.0.10.tar.gz (68kB)
Installing collected packages: pyodbc
Running setup.py install for pyodbc: started
Running setup.py install for pyodbc: finished with status 'error'
Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fUZvJJ/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mAZud2-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/tmp
creating build/temp.linux-x86_64-2.7/tmp/pip-build-fUZvJJ
creating build/temp.linux-x86_64-2.7/tmp/pip-build-fUZvJJ/pyodbc
creating build/temp.linux-x86_64-2.7/tmp/pip-build-fUZvJJ/pyodbc/src
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYODBC_VERSION=3.0.10 -DPYODBC_UNICODE_WIDTH=4 -DSQL_WCHART_CONVERT=1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/usr/local/include/python2.7 -c /tmp/pip-build-fUZvJJ/pyodbc/src/row.cpp -o build/temp.linux-x86_64-2.7/tmp/pip-build-fUZvJJ/pyodbc/src/row.o -Wno-write-strings
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from /tmp/pip-build-fUZvJJ/pyodbc/src/row.cpp:12:
/tmp/pip-build-fUZvJJ/pyodbc/src/pyodbc.h:52:17: error: sql.h: No such file or directory
/tmp/pip-build-fUZvJJ/pyodbc/src/pyodbc.h:53:20: error: sqlext.h: No such file or directory
In file included from /tmp/pip-build-fUZvJJ/pyodbc/src/row.cpp:12:
/tmp/pip-build-fUZvJJ/pyodbc/src/pyodbc.h:69: error: 'IsSet' declared as an 'inline' variable
/tmp/pip-build-fUZvJJ/pyodbc/src/pyodbc.h:69: error: 'DWORD' was not declared in this scope
/tmp/pip-build-fUZvJJ/pyodbc/src/pyodbc.h:69: error: 'DWORD' was not declared in this scope
/tmp/pip-build-fUZvJJ/pyodbc/src/pyodbc.h:69: error: initializer expression list treated as compound expression
/tmp/pip-build-fUZvJJ/pyodbc/src/pyodbc.h:70: error: expected ',' or ';' before '{' token
In file included from /tmp/pip-build-fUZvJJ/pyodbc/src/row.cpp:13:
/tmp/pip-build-fUZvJJ/pyodbc/src/pyodbcmodule.h:36: error: 'HENV' does not name a type
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fUZvJJ/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mAZud2-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-fUZvJJ/pyodbc
PySide:
Step 13 : RUN pip install -i https://pypi.python.org/pypi PySide
---> Running in 5e00a3b909cb
Collecting PySide
Downloading PySide-1.2.4.tar.gz (9.3MB)
Installing collected packages: PySide
Running setup.py install for PySide: started
Running setup.py install for PySide: finished with status 'error'
Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6DcOnP/PySide/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xcmRJq-record/install-record.txt --single-version-externally-managed --compile:
Removing /tmp/pip-build-6DcOnP/PySide/pyside_package
running install
running build
Python architecture is 64bit
error: Failed to find cmake. Please specify the path to cmake with --cmake parameter.
----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6DcOnP/PySide/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xcmRJq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-6DcOnP/PySide
我现在已经被困在这两天了,并且无法解决这个问题。
以下是一些技术细节:
我是主机运行ubuntu 16,但是我从一个拥有centos6.6操作系统的docker容器运行所有这些命令。
uname -r: 4.4.0-31泛型
对我而言,它看起来像是要匹配的python和c函数定义/声明之一。