类似的cython问题在centos6.6上安装python包

2024-10-03 17:15:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试从pypi(os:centos6.6)安装以下python包:

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开始:

^{pr2}$

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

我已经被困在这个问题上两天了,我想不通。在

以下是一些更多的技术细节:

我是运行Ubuntu16的主机,但我从一个docker容器运行所有这些命令,它有一个centos6.6操作系统。在

uname-r: 4.4.0-31-通用

对我来说,它看起来像是python和c函数定义/声明中的一个不匹配。在


Tags: installpippybuildsrcpypisetuperror