Can't install mysql-python version 1.…

2018-06-17 22:55:32来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

 

Can't install mysql-python version 1.2.5 in Windows

            
http://stackoverflow.com/questions/37092125/cant-install-mysql-python-version-1-2-5-in-windows
         up vote0down votefavorite
 

I have mysql-python v1.2.4 installed just fine on my machine (Windows 8). I am using Python 2.7. I always got this below error every time I try to upgrade to v1.2.5.

C:\Users\User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\

9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'fi nal',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.  0.2\include" -Ic:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fobuild\temp.wi n32-2.7\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:\Users\User\AppData\Local\Programs\Common\Microsoft \Visual  C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2

----------------------------------------   Rolling back uninstall of mysql-python Command "c:\python27\python.exe -u -c "import

setuptools, tokenize;file='c:\  \users\user\appdata\local\temp\pip-build-utz7of\MySQL-python\setup.py';ex  ec(compile(getattr(tokenize, 'open',  open)(file).read().replace('\r\n', '\n' ), file, 'exec'))"  install --record c:\users\user\appdata\local\temp\pip-osy  _cg-record\install-record.txt --single-version-externally-managed --compile" fai led with error code 1 in c:\users\user\appdata\local\temp\pip-build-utz7of\MySQL  -python\

I've tried (and none work):

  1. Installing VS2010
  2. Changing Python Path
  3. Using Wheel module (I got Failed building wheel for MySQL-python)
  4. Installing Python MySQL connector. For both Python and C.
  5. Installing mysqlclient
  6. Installing using Exe installer from https://pypi.python.org/pypi/mysql-python/1.2.5

Do I miss something? Thanks.

share|improve this question

 

 

 

                                                                                                                    
I don't understand why do I get a down vote. It is similar to some questions, but I've tried their solution and none work. Please explain the down vote reason if you want to act that way                     – Aminah Nuraini                 May 9 at 4:28                                                                            
                                                                                                                    
What happened when you used the exe installer?                     – Burhan Khalid                 May 9 at 4:46                                                                            
                                                                                                                    
It got installed just fine, but then I still fail to install mysql-python                     – Aminah Nuraini                 May 9 at 4:49                                                                            
                                                                                                                    
How do you know it failed? Did you try to import it and get an error?                     – Burhan Khalid                 May 9 at 5:24                                                                            
                                                                                                                    
I keep getting the error I've pasted in the question. Can't find config-win.h, etc.                     – Aminah Nuraini                 May 9 at 5:54                                                                            

1 Answer                                 1

            active                     oldest                     votes
         up vote0down voteaccepted

I solved it myself.

I use the wheel installer from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python.

There are two wheel packages there. The amd64 one refuses to install on my platform (Windows) but the other one works just fine. I mean the file with this name:

MySQL_python-1.2.5-cp27-none-win32.whl

Then install it by running this below command in the same folder with the wheel package.

pip install MySQL_python-1.2.5-cp27-none-win32.whl
share|improve this answer

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:MySQL查询昨天、今天、7天、近30天、本月、上一月数据

下一篇:python3.4怎么连接mysql pymysql连接mysql数据库