当我尝试使用pip来安装我的mysql时,我遇到了以下错误
C:\Users\user>pip install oursql
Collecting oursql
Using cached https://files.pythonhosted.org/packages/8c/88/9f53a314a2af6f56c0a1249c5673ee384b85dc791bac5c1228772ced3502/oursql-0.9.3.2.tar.gz
Installing collected packages: oursql
Running setup.py install for oursql ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\user\\appdata\\local\\temp\\pip-install-l7rkx0\\oursql\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-record-yke4zh\install-record.txt --single-version-externally-managed --compile:
cython not found, using previously-cython'd .c file.
running install
running build
running build_ext
error: [Error 2] The system cannot find the file specified
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\user\\appdata\\local\\temp\\pip-install-l7rkx0\\oursql\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-record-yke4zh\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\user\appdata\local\temp\pip-install-l7rkx0\oursql\
当我尝试从源代码
安装时遇到同样的错误C:\Users\user\Downloads\oursql-0.9.3.1>python setup.py install
cython not found, using previously-cython'd .c file.
running install
running build
running build_ext
error: [Error 2] The system cannot find the file specified
我尝试以管理员身份运行cmd,但发生了同样的错误。任何帮助都将不胜感激。
(Windows 10,Python 2.7)
答案 0 :(得分:0)
https://github.com/python-oursql/oursql/issues/18
您需要Cython来编译oursql
,因为作者忘记提交生成的模块。
由于我们的myql的作者似乎消失了我forked the module,提交错过了生成的文件并应用了pull requests。我怀疑我会进一步发展它,但我可以接受拉取请求。