簡體   English   中英

使用pip安裝MySQL在Windows上安裝MySQL-python無法正常工作?

[英]Install MySQL using pip install MySQL-python on Windows not working?

我無法安裝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

我要做的就是轉到oracle,然后下載MySQL Connector C 6.0.2並進行典型安裝。

http://dev.mysql.com/downloads/connector/c/6.0.html#downloads

完成此操作后,我進入pycharms,並選擇要安裝的MySQL-python == 1.2.4軟件包,它運行良好。 無需更新任何配置或類似內容。 對於我來說,這是最簡單的版本。

希望能幫助到你。

此處的 pypi列表中,mysql db當前支持python 2.7以上的版本。 雖然還有其他mysql軟件包,請參見mysqlclient

https://pypi.python.org/pypi/MySQL-python/1.2.5安裝.exe安裝程序對我來說很有效。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM