gpt4 book ai didi

python - 构建 '_mysql' 扩展错误 : Unable to find vcvarsall. bat

转载 作者:行者123 更新时间:2023-11-29 11:59:13 26 4
gpt4 key购买 nike

我正在尝试通过 pip mysql 安装 python 3.5。我发现我缺少文件 vcvarsall.bat“C:\Program Files(x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat”但我不知道如何修改istall脚本以指向vcvarsall.bat

这是安装的输出。我已经尝试过建议的解决方案,我已经安装了 Express 8、Windows SDK,但似乎没有任何帮助。

PS C:\Python35\Scripts> .\pip.exe install mysqlCollecting mysql  Downloading mysql-0.0.1.tar.gzCollecting MySQL-python (from mysql)  Downloading MySQL-python-1.2.5.zip (108kB)    100% |################################| 110kB 866kB/sInstalling collected packages: MySQL-python, mysql  Running setup.py install for MySQL-python    Complete output from command     c:\python35\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\Arthur\\AppData\\Local\\Temp\\pip-build t876fqxc\\MySQL-pyth    n\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Arthur\AppData\Local\Temp    pip-ohodnfbo-record\install-record.txt --single-version-externally-managed --compile:    running install    running build    running build_py    creating build    creating build\lib.win-amd64-3.5    copying _mysql_exceptions.py -> build\lib.win-amd64-3.5    creating build\lib.win-amd64-3.5\MySQLdb    copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb    copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb    copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb    copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb    copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb    copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb    creating build\lib.win-amd64-3.5\MySQLdb\constants    copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants    copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants    copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants    copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants    copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants    copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants    running build_ext    building '_mysql' extension    error: Unable to find vcvarsall.bat

UPDATE. vsvarsall.bat error is gone, after I put a copy of it into bin folder of VC express.

But now I get this error

 cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\hon35\include -Ic:\python35\include /Tc_mysql.c /Fobuild\temp.win-amd64-3.5\Release\_mysql.obj /Zl error: command '**cl.exe**' failed: No such file or directory

But when I put a copy of cl.exe in Windows folder I get this error:

<pre>
command 'C:\\WINDOWS\\cl.exe' failed with exit status -1073741515
</pre>

pip 安装脚本位于哪里?

已解决

After I installed Microsoft Community Edition, now I have in
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

cl.exe 适用于在我的 amd64 位机器上编译 Python 3.5 模块

最佳答案

尝试使用 pymysql。 https://github.com/PyMySQL/PyMySQL

它是纯Python,因此您无需担心构建任何东西来使其工作。我都用过,而且它们对我来说都非常有效。

关于python - 构建 '_mysql' 扩展错误 : Unable to find vcvarsall. bat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32656126/

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