尝试为 MySQL-python 安装 install [英] Trying to install install for MySQL-python

查看:45
本文介绍了尝试为 MySQL-python 安装 install的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 MySQL-python 安装 install ,但出现此错误,需要安装 Microsoft Visual C++ 14.0.

 错误:命令出错,退出状态为 1:命令:'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize;sys.argv[0] = '"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-iwizu2ag\\MySQL-python\\setup.py'"'"';__file__='"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-iwizu2ag\\MySQL-python\\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\pc\AppData\Local\Temp\pip-record-vnvrbcv_\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python37\Include\MySQL-python'cwd: C:\Users\pc\AppData\Local\Temp\pip-install-iwizu2ag\MySQL-python\完整输出(24 行):运行安装运行构建运行 build_py创建构建创建 build\lib.win32-3.7复制 _mysql_exceptions.py ->构建\lib.win32-3.7创建 build\lib.win32-3.7\MySQLdb复制 MySQLdb\__init__.py ->构建\lib.win32-3.7\MySQLdb复制 MySQLdb\converters.py ->构建\lib.win32-3.7\MySQLdb复制 MySQLdb\connections.py ->构建\lib.win32-3.7\MySQLdb复制 MySQLdb\cursors.py ->构建\lib.win32-3.7\MySQLdb复制 MySQLdb\release.py ->构建\lib.win32-3.7\MySQLdb复制 MySQLdb\times.py ->构建\lib.win32-3.7\MySQLdb创建 build\lib.win32-3.7\MySQLdb\constants复制 MySQLdb\constants\__init__.py ->build\lib.win32-3.7\MySQLdb\constants复制 MySQLdb\constants\CR.py ->build\lib.win32-3.7\MySQLdb\constants复制 MySQLdb\constants\FIELD_TYPE.py ->build\lib.win32-3.7\MySQLdb\constants复制 MySQLdb\constants\ER.py ->build\lib.win32-3.7\MySQLdb\constants复制 MySQLdb\constants\FLAG.py ->build\lib.win32-3.7\MySQLdb\constants复制 MySQLdb\constants\REFRESH.py ->build\lib.win32-3.7\MySQLdb\constants复制 MySQLdb\constants\CLIENT.py ->build\lib.win32-3.7\MySQLdb\constants运行 build_ext构建_mysql"扩展错误:需要 Microsoft Visual C++ 14.0.使用Visual Studio 构建工具"获取它:https://visualstudio.microsoft.com/downloads/---------------------------错误:命令出错,退出状态为 1:'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize;sys.argv[0] = '"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-iwizu2ag\\MySQL-python\\setup.py'"'"';__file__='"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-iwizu2ag\\MySQL-python\\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\pc\AppData\Local\Temp\pip-record-vnvrbcv_\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python37\Include\MySQL-python' 检查日志用于完整的命令输出.

实际上,我的设备上安装了 Microsoft Visual c++ 15

解决方案

所以在收到同样的错误信息后.

我按照消息说的做了.

下载并安装了构建工具.

我在 Micorsoft 下载页面上找不到它们,所以这里是一个链接

I am trying to install install for MySQL-python , but i have this error that require installing Microsoft Visual C++ 14.0 is required.

 ERROR: Command errored out with exit status 1:
     command: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-iwizu2ag\\MySQL-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-iwizu2ag\\MySQL-python\\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\pc\AppData\Local\Temp\pip-record-vnvrbcv_\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python37\Include\MySQL-python'
         cwd: C:\Users\pc\AppData\Local\Temp\pip-install-iwizu2ag\MySQL-python\
    Complete output (24 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    copying _mysql_exceptions.py -> build\lib.win32-3.7
    creating build\lib.win32-3.7\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
    copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
    copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
    creating build\lib.win32-3.7\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.7\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
    running build_ext
    building '_mysql' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-iwizu2ag\\MySQL-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-iwizu2ag\\MySQL-python\\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\pc\AppData\Local\Temp\pip-record-vnvrbcv_\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python37\Include\MySQL-python' Check the logs for full command output.

Actually , I have Microsoft visual c++ 15 installed on my device

解决方案

So after getting the same error message.

I did what the message said.

Downloaded and installed the build tools.

I couldn't find them on Micorsoft download page so here is a link

https://aka.ms/vs/16/release/vs_buildtools.exe

After installing is selected the options in the image and it worked

这篇关于尝试为 MySQL-python 安装 install的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆