gcc: _mssql.c: 没有这样的文件或目录

发布于 2024-12-27 13:14:08 字数 2573 浏览 1 评论 0原文

我正在尝试为 python 2.5 编译 pymssql。我这样做是因为我认为我的 pymssql 版本是为 python 2.4 编译的。这是我得到的错误,这让我想到:

/home/username/lib/python2.5/pymssql.py:30: RuntimeWarning: Python C API version mismatch for module _mssql: This Python has API version 1013, module _mssql has version 1012.
import _mssql

无论如何,我在 Ubuntu 10.10 上,并通过 deadsnakes ppa。我已经使用 python2.5 创建了一个 virtualenv,就像这样

mkvirtualenv pymssql -p /usr/bin/python2.5

我已经从 pip 安装 cython 并尝试从 pip 安装 pymssql,但收到此错误

Downloading/unpacking pymssql
  Running setup.py egg_info for package pymssql
Installing collected packages: pymssql
  Running setup.py install for pymssql
    building '_mssql' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/neil/virtualenv/pymssql/build/pymssql/freetds/nix_32/include -I/usr/include/python2.5 -c _mssql.c -o build/temp.linux-i686-2.5/_mssql.o -DMSDBLIB
    gcc: _mssql.c: No such file or directory
    gcc: no input files
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/neil/virtualenv/pymssql/bin/python2.5 -c "import setuptools;__file__='/home/neil/virtualenv/pymssql/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-cEGXRy-record/install-record.txt --install-headers /home/neil/virtualenv/pymssql/include/site/python2.5:
    running install

running build

running build_ext

building '_mssql' extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/neil/virtualenv/pymssql/build/pymssql/freetds/nix_32/include -I/usr/include/python2.5 -c _mssql.c -o build/temp.linux-i686-2.5/_mssql.o -DMSDBLIB

gcc: _mssql.c: No such file or directory

gcc: no input files

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /home/neil/virtualenv/pymssql/bin/python2.5 -c "import setuptools;__file__='/home/neil/virtualenv/pymssql/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-cEGXRy-record/install-record.txt --install-headers /home/neil/virtualenv/pymssql/include/site/python2.5 failed with error code 1
Storing complete log in /home/neil/.pip/pip.log

有任何想法如何解决此问题吗?

I'm trying to compile pymssql for python 2.5. I'm doing this because I think the version of pymssql I have is compiled for python 2.4. This is the error I get which makes me think that:

/home/username/lib/python2.5/pymssql.py:30: RuntimeWarning: Python C API version mismatch for module _mssql: This Python has API version 1013, module _mssql has version 1012.
import _mssql

Anyway I'm on Ubuntu 10.10 and have installed python2.5 and python2.5-dev via the deadsnakes ppa. I've created an virtualenv with using python2.5 like so

mkvirtualenv pymssql -p /usr/bin/python2.5

I've install cython from pip and am trying to install pymssql from pip but am getting this error

Downloading/unpacking pymssql
  Running setup.py egg_info for package pymssql
Installing collected packages: pymssql
  Running setup.py install for pymssql
    building '_mssql' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/neil/virtualenv/pymssql/build/pymssql/freetds/nix_32/include -I/usr/include/python2.5 -c _mssql.c -o build/temp.linux-i686-2.5/_mssql.o -DMSDBLIB
    gcc: _mssql.c: No such file or directory
    gcc: no input files
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/neil/virtualenv/pymssql/bin/python2.5 -c "import setuptools;__file__='/home/neil/virtualenv/pymssql/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-cEGXRy-record/install-record.txt --install-headers /home/neil/virtualenv/pymssql/include/site/python2.5:
    running install

running build

running build_ext

building '_mssql' extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/neil/virtualenv/pymssql/build/pymssql/freetds/nix_32/include -I/usr/include/python2.5 -c _mssql.c -o build/temp.linux-i686-2.5/_mssql.o -DMSDBLIB

gcc: _mssql.c: No such file or directory

gcc: no input files

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /home/neil/virtualenv/pymssql/bin/python2.5 -c "import setuptools;__file__='/home/neil/virtualenv/pymssql/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-cEGXRy-record/install-record.txt --install-headers /home/neil/virtualenv/pymssql/include/site/python2.5 failed with error code 1
Storing complete log in /home/neil/.pip/pip.log

Any ideas how to resolve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我很坚强 2025-01-03 13:14:08

原来我需要从 pip 安装 Pyrex。

pip install pyrex

Turns out I needed to install pyrex from pip.

pip install pyrex
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文