本文介绍了如何使用VIsual Studio Code 2017安装mysql包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 安装"MySQL"时在Visual Studio Code 2017中使用python包,我收到以下错误 - 请让我帮助在VC-2017中使用python安装MySQL包,并帮助我连接SQL数据库。 谢谢!! 错误 -   > pip install mysql 收集mysql 收集MySQL-python(来自mysql)  使用缓存的MySQL-python-1.2.5.zip 为收集的包构建轮子:MySQL-python  为MySQL-python运行setup.py bdist_wheel ...错误  从命令"C:\Program Files \ Anaconda3 \ python.exe"完成输出-u -c"import setuptools,tokenize; __ file __ ='C:\\Users \\Dell \\AppData \\ Local \\Temp \\pip-build-oqwmnfhy \\MySQL-python \\setup.py'; f = getattr(tokenize,'open',open)(__ file __); code = f.read()。replace('\\\\' ,'\ n'); f.close(); exec(compile(code,__ file __,'exec'))" bdist_wheel -d C:\ Users \Dell\AppData \ Local \Temp \ tmp7wowaklzpip-wheel- - python-tag cp36:  正在运行bdist_wheel  正在运行的构建  正在运行build_py  创建版本 创建build \lib.win-amd64-3.6  复制_mysql_exceptions.py - > build \lib.win-amd64-3.6  创建build \lib.win-amd64-3.6 \ MySQLdb  复制MySQLdb\__init __。py - > build \lib.win-amd64-3.6 \ MySQLdb  复制MySQLdb\converters.py - > build \lib.win-amd64-3.6 \ MySQLdb  复制MySQLdb\connections.py - > build \lib.win-amd64-3.6 \ MySQLdb  复制MySQLdb\cursors.py - > build \lib.win-amd64-3.6 \ MySQLdb  复制MySQLdb \ release.py - > build \lib.win-amd64-3.6 \ MySQLdb  复制MySQLdb \ times.py - > build \lib.win-amd64-3.6 \ MySQLdb  创建build \lib.win-amd64-3.6 \ MySQLdb \constants  复制MySQLdb \ constants \ ____ __。py - > build \lib.win-amd64-3.6 \ MySQLdb \constants  复制MySQLdb \ constants \ CR.py - > build \lib.win-amd64-3.6 \ MySQLdb \constants  复制MySQLdb \ constants \ FIELD_TYPE.py - > build \lib.win-amd64-3.6 \ MySQLdb \constants  复制MySQLdb\constants\ER.py - > build \lib.win-amd64-3.6 \ MySQLdb \constants  复制MySQLdb \ constants \FLAG.py - > build \lib.win-amd64-3.6 \ MySQLdb \constants  复制MySQLdb \ constants \ REFRESH.py - > build \lib.win-amd64-3.6 \ MySQLdb \constants  复制MySQLdb \ constants \CLIENT.py - > build \lib.win-amd64-3.6 \ MySQLdb \constants  正在运行build_ext  建立'_mysql'扩展名为 创建build\temp.win-amd64-3.6  创建build\temp.win-amd64-3.6 \发布   C:\Program Files(x86)\ Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe / c / nologo / Ox / W3 / GL / DNDEBUG / MD -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:\Program Files \ Anaconda3 \ include"" "-IC:\Program Files\Anaconda3 \ include" " -IC:\Program Files(x86)\ Microsoft Visual Studio 14.0\VC \INCLUDE" "-IC:\Program Files(x86)\ Windows Wits \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "-IC:\Program Files (x86)\ Windows Wits\NETFXSDK \4.6.1 \include\\\" "-IC:\Program Files(x86)\ Windows Wits \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "-IC:\Program Files(x86)\ Windows Wits \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "-IC:\Program Files(x86)\ Windows Wits\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ /Tc_mysql.c /Fobuild\temp.win-amd64-3.6\Release\_mysql.obj / Zl   _mysql.c   _mysql.c(42):致命错误C1083:无法打开包含文件:'config-win.h':没有这样的文件或目录  错误:命令'C:\\Program Files(x86)\\ Microsoft Visual Studio 14.0 \\VC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 2 解决方案 While installing "MySQL" package using python in Visual Studio Code 2017, I am getting following error-Please let me help to install MySQL package using python in VC-2017 and help me to connect SQL database though it.Thanks !!Error - >pip install mysqlCollecting mysqlCollecting MySQL-python (from mysql)  Using cached MySQL-python-1.2.5.zipBuilding wheels for collected packages: MySQL-python  Running setup.py bdist_wheel for MySQL-python ... error  Complete output from command "C:\Program Files\Anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-build-oqwmnfhy\\MySQL-python\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Dell\AppData\Local\Temp\tmp7wowaklzpip-wheel- --python-tag cp36:  running bdist_wheel  running build  running build_py  creating build  creating build\lib.win-amd64-3.6  copying _mysql_exceptions.py -> build\lib.win-amd64-3.6  creating build\lib.win-amd64-3.6\MySQLdb  copying MySQLdb\__init__.py -> build\lib.win-amd64-3.6\MySQLdb  copying MySQLdb\converters.py -> build\lib.win-amd64-3.6\MySQLdb  copying MySQLdb\connections.py -> build\lib.win-amd64-3.6\MySQLdb  copying MySQLdb\cursors.py -> build\lib.win-amd64-3.6\MySQLdb  copying MySQLdb\release.py -> build\lib.win-amd64-3.6\MySQLdb  copying MySQLdb\times.py -> build\lib.win-amd64-3.6\MySQLdb  creating build\lib.win-amd64-3.6\MySQLdb\constants  copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants  copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants  copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants  copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants  copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants  copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.6\MySQLdb\constants  copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants  running build_ext  building '_mysql' extension  creating build\temp.win-amd64-3.6  creating build\temp.win-amd64-3.6\Release  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -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:\Program Files\Anaconda3\include" "-IC:\Program Files\Anaconda3\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt" /Tc_mysql.c /Fobuild\temp.win-amd64-3.6\Release\_mysql.obj /Zl  _mysql.c  _mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 解决方案 这篇关于如何使用VIsual Studio Code 2017安装mysql包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-03 02:18