如何使用VIsual Studio Code 2017安装mysql包? [英] How to install mysql package using VIsual Studio Code 2017?

查看:135
本文介绍了如何使用VIsual Studio Code 2017安装mysql包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装"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

解决方案

Hi Swapnil2195,


欢迎来到MSDN论坛。


请参阅您的描述,您的问题是关于Python开发。由于我们的论坛是讨论VS IDE,请重定向到这个适当的论坛:
https://github.com/Microsoft / PTVS /问题并开始新的问题以寻求更专业的支持,感谢您的理解。


同时,根据错误消息,我发现了一些类似的问题如下,希望它对您的问题有所帮助,对不起任何不便。


"无法打开包含文件:'config-win.h':
安装mysql-python时没有这样的文件或目录


< p style ="margin-bottom:12pt"> mysql-python安装致命错误




最好的问候,


萨拉


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 mysql
Collecting mysql
Collecting MySQL-python (from mysql)
  Using cached MySQL-python-1.2.5.zip
Building 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

解决方案

Hi Swapnil2195,

Welcome to the MSDN forum.

Refer to your description, your issue is about the Python development. Since our forum is to discuss the VS IDE, please redirect to this appropriate forum: https://github.com/Microsoft/PTVS/issues and start a new issue to seek for a more professional support, thank you for your understanding.

Meanwhile, per the error message, I found some similar issues as below and hope it will helpful for your issue, sorry for any inconveniences.

"Cannot open include file: 'config-win.h': No such file or directory" while installing mysql-python

mysql-python install fatal error

Best regards,

Sara


这篇关于如何使用VIsual Studio Code 2017安装mysql包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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