gpt4 book ai didi

python - Oursql 安装失败,出现 "cython not found"

转载 作者:可可西里 更新时间:2023-11-01 07:06:24 25 4
gpt4 key购买 nike

尝试在 ubuntu 12.10 上为 python3x 和 sqlalchemy0.8 安装 oursql 驱动程序。它失败并出现以下错误。

sudo pip-3.2 install oursql
Downloading/unpacking oursql
Running setup.py egg_info for package oursql
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build/oursql/setup.py", line 53
print "cython not found, using previously-cython'd .c file."
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 16, in <module>

File "/tmp/pip-build/oursql/setup.py", line 53

print "cython not found, using previously-cython'd .c file."

^

SyntaxError: invalid syntax

当我尝试安装 cython 时,我似乎已经安装了它:

sudo pip-3.2 install cython
Requirement already satisfied (use --upgrade to upgrade): cython in /usr/local/lib/python3.2/dist-packages
Cleaning up.

我该怎么做才能让它运行?

最佳答案

运行pip-3.2时出现同样的错误。

我是这样实现的:

使用 python-3.2 创建了我的env:

virtualenv -p /usr/bin/python3.2

安装所需的包:

sudo apt-get install python-dev

sudo apt-get install libmysqlclient-dev

然后安装:

sudo pip install cython

sudo pip install oursql

编辑1:

我能够通过我上面的建议得到你的错误,但我错了(python3.2 无法读取 oursql)。我尝试了以下并能够建立连接:

首先:

sudo apt-get install python3.2-dev

然后从源代码为 Python 3 安装 oursql(按照其维护者的建议 here ):

Get the Python 3 version of oursql from here and compile it from source (Don't have enough reputation to post the link, just go to oursql official site for installation instructions).

关于python - Oursql 安装失败,出现 "cython not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15182815/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com