Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用pip安装MySQL在Windows上安装MySQL python不工作?_Python_Mysql_Windows - Fatal编程技术网

使用pip安装MySQL在Windows上安装MySQL python不工作?

使用pip安装MySQL在Windows上安装MySQL python不工作?,python,mysql,windows,Python,Mysql,Windows,我无法安装mysql软件包,并查看了许多解决方案,但都没有解决问题。请帮忙,告诉我需要做些什么才能让这一切顺利进行 运行命令后,将显示以下内容: Collecting mysql-python Using cached MySQL-python-1.2.5.zip Installing collected packages: mysql-python Running setup.py install for mysql-python Complete output from command "C

我无法安装mysql软件包,并查看了许多解决方案,但都没有解决问题。请帮忙,告诉我需要做些什么才能让这一切顺利进行

运行命令后,将显示以下内容:

Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Installing collected packages: mysql-python
Running setup.py install for mysql-python
Complete output from command "C:\Program Files (x86)\Python_3.4.3\python.exe
" -c "import setuptools, tokenize;__file__='C:\\Users\\RNN\\AppData\\Local\\Temp
\\pip-build-rauxmcb1\\mysql-python\\setup.py';exec(compile(getattr(tokenize, 'op
en', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install -
-record C:\Users\RNN\AppData\Local\Temp\pip-0cir5bet-record\install-record.txt -
-single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.4
copying _mysql_exceptions.py -> build\lib.win32-3.4
creating build\lib.win32-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.4\MySQLdb
creating build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.4\MySQLdb\constan
ts
copying MySQLdb\constants\CR.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.4\MySQLdb\const
ants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.4\MySQLdb\constant
s
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.4\MySQLdb\constants

running build_ext
building '_mysql' extension
creating build\temp.win32-3.4
creating build\temp.win32-3.4\Release
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GS- /DNDEBUG -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 F
iles (x86)\Python_3.4.3\include" "-IC:\Program Files (x86)\Python_3.4.3\include"
/Tc_mysql.c /Fobuild\temp.win32-3.4\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 10.0\\VC\\B
IN\\cl.exe' failed with exit status 2
Command ""C:\Program Files (x86)\Python_3.4.3\python.exe" -c "import setuptools,
 tokenize;__file__='C:\\Users\\RNN\\AppData\\Local\\Temp\\pip-build-rauxmcb1\\my
sql-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\RNN\App
Data\Local\Temp\pip-0cir5bet-record\install-record.txt --single-version-external
ly-managed --compile" failed with error code 1 in C:\Users\RNN\AppData\Local\Tem
p\pip-build-rauxmcb1\mysql-python
然后这是红色的:

Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Installing collected packages: mysql-python
Running setup.py install for mysql-python
Complete output from command "C:\Program Files (x86)\Python_3.4.3\python.exe
" -c "import setuptools, tokenize;__file__='C:\\Users\\RNN\\AppData\\Local\\Temp
\\pip-build-rauxmcb1\\mysql-python\\setup.py';exec(compile(getattr(tokenize, 'op
en', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install -
-record C:\Users\RNN\AppData\Local\Temp\pip-0cir5bet-record\install-record.txt -
-single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.4
copying _mysql_exceptions.py -> build\lib.win32-3.4
creating build\lib.win32-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.4\MySQLdb
creating build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.4\MySQLdb\constan
ts
copying MySQLdb\constants\CR.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.4\MySQLdb\const
ants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.4\MySQLdb\constant
s
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.4\MySQLdb\constants

running build_ext
building '_mysql' extension
creating build\temp.win32-3.4
creating build\temp.win32-3.4\Release
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GS- /DNDEBUG -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 F
iles (x86)\Python_3.4.3\include" "-IC:\Program Files (x86)\Python_3.4.3\include"
/Tc_mysql.c /Fobuild\temp.win32-3.4\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 10.0\\VC\\B
IN\\cl.exe' failed with exit status 2
Command ""C:\Program Files (x86)\Python_3.4.3\python.exe" -c "import setuptools,
 tokenize;__file__='C:\\Users\\RNN\\AppData\\Local\\Temp\\pip-build-rauxmcb1\\my
sql-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\RNN\App
Data\Local\Temp\pip-0cir5bet-record\install-record.txt --single-version-external
ly-managed --compile" failed with error code 1 in C:\Users\RNN\AppData\Local\Tem
p\pip-build-rauxmcb1\mysql-python

我所要做的就是转到oracle,下载MySQL连接器C6.0.2并进行典型的安装

完成后,我进入pycharms,选择MySQL python==1.2.4包进行安装,效果非常好。不需要更新任何配置或类似的内容。这对我来说是最简单的版本


希望能有所帮助。

在pypi列表中,mysql db目前支持python,最高支持2.7版。不过还有其他mysql软件包,请参阅。

从安装.exe安装程序为我工作。

pycharms?我应该安装吗?连接器有什么用?不,你不需要pycharm。只需安装连接器,然后使用pip安装mysql python。MySQL Connector/ODBC(有时称为Connector ODBC或MyODBC)是通过开放数据库连接(ODBC)应用程序接口(API)连接MySQL数据库服务器的驱动程序,这是连接任何数据库的标准方式。请确保下载32位版本的连接器。对于32位连接器,它将与MySQL python==1.2.5一起工作