![安装 python pymssql](https://linux22.com/image/1393661/%E5%AE%89%E8%A3%85%20python%20pymssql.png)
我正在尝试安装 pymssql,但没有成功:
pip install pymssql
Downloading/unpacking pymssql
Downloading pymssql-2.0.1.tar.bz2 (1.9MB): 1.9MB downloaded
Running setup.py (path:/tmp/pip_build_root/pymssql/setup.py) egg_info for package pymssql
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('32bit', 'ELF')
setup.py: platform.linux_distribution() => ('debian', '7.3', '')
setup.py: platform.libc_ver() => ('glibc', '2.3.4')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
warning: no files found matching 'win32/freetds.zip'
Installing collected packages: pymssql
Running setup.py install for pymssql
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('32bit', 'ELF')
setup.py: platform.linux_distribution() => ('debian', '7.3', '')
setup.py: platform.libc_ver() => ('glibc', '2.3.4')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
building '_mssql' extension
i486-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-i686-2.7/_mssql.o -DMSDBLIB
_mssql.c:8:22: fatal error: pyconfig.h: No such file or directory
#include "pyconfig.h"
^
compilation terminated.
error: command 'i486-linux-gnu-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptoolº tokenize;__file__='/tmp/pip_build_root/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8cJl01-record/install-record.txt --single-version-externally-managed --compile:
setup.py: platform.system() => 'Linux'
setup.py: platform.architecture() => ('32bit', 'ELF')
setup.py: platform.linux_distribution() => ('debian', '7.3', '')
setup.py: platform.libc_ver() => ('glibc', '2.3.4')
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']
running install
running build
running build_ext
building '_mssql' extension
creating build
creating build/temp.linux-i686-2.7
i486-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-i686-2.7/_mssql.o -DMSDBLIB
_mssql.c:8:22: fatal error: pyconfig.h: No such file or directory
#include "pyconfig.h"
^
compilation terminated.
error: command 'i486-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptoolº tokenize;__file__='/tmp/pip_build_root/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8cJl01-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pymssql
Storing debug log for failure in /root/.pip/pip.log
知道为什么吗?
答案1
可能是你丢失了python-dev
包裹