Python Installation Mysql-python failure

Source: Internet
Author: User



Install pip install Mysql-python Fault Resolution!

   running build_ext    building  ' _mysql '  extension     error: Microsoft Visual C++ 9.0 is required  (unable  To find vcvarsall.bat) . get it from http://aka.ms/vcpython27     ----------------------------------------command  "c:\python27\python.exe -u -c " Import setuptools, tokenize;__file__= ' c:\\users\\gaogd\\appdata\\local\\temp\\pip-build-btgsva\\ Mysql-python\\setup.py '; Exec (Compile (getattr (tokenize,  ' open ',  open) (__file__). Read (). replace (' \ r \ n ' ,  ' \ n ') (, __file__,  ' exec ')) " install --record c:\users\gaogd\appdata\local\temp\ Pip-ijueoq-record\install-record.txt --single-version-externally-managed --compile " failed  with error code 1 in c:\users\gaogd\appdata\local\temp\pip-build-btgsva\ Mysql-pythonc:\users\gaogd>


Download the installation:

Windows PIP installation package error: Microsoft Visual C + + 9.0 is required unable to find Vcvarsall.bat just installed the PIP on the machine in the Windows environment to facilitate the installation of the package later when the use, who know the first time to use PIP installation Asyncio error. Prompt error when using PIP to install package under windows7x64: Microsoft Visual C + + 9.0 is required (unable to find Vcvarsall.bat) environment: Windows7 x64, Python2. 7, VS2012 Reason: Windows use PIP installation package when the machine needs to be equipped with vs2008,vs2012 is not enough, if you do not want to install VS2008, can be installed a micorsoft Visual C + + Compiler for Python 2.7 of packages
http://www.microsoft.com/en-us/download/details.aspx?id=44266


Error 2

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/86/11/wKioL1e0CVaxFV70AABeKDHmqU0369.png-wh_500x0-wm_3 -wmp_4-s_969539620.png "title=" 11.png "alt=" Wkiol1e0cvaxfv70aabekdhmqu0369.png-wh_50 "/>


Workaround: Execute the following script:

import sys      from _winreg import *       # tweak as necessary  version = sys.version[:3]   installpath = sys.prefix      regpath =  "software\\ Python\\pythoncore\\%s\\ " %  (version)   installkey = " InstallPath "   pythonkey =  "PythonPath"   pythonpath =  "%s;%s\\lib\\;%s\\dlls\\"  %  (       installpath, installpath, installpath  )        def registerpy ():      try:           reg = openkey (Hkey_current_user, regpath)        except EnvironmentError as e:           try:  &Nbsp;           reg = createkey (HKEY_CURRENT_ User, regpath)                SetValue (Reg, installkey, reg_sz, installpath)                setvalue (Reg, pythonkey, reg_sz, pythonpath)                closekey (REG)            except:               print  "*** unable to register!"               return           print  "--- python", version,  "is now  registered! "           return      if  (QueryValue (Reg, installkey)  ==  Installpath and          queryvalue (Reg, pythonkey )  == pythonpath):           closekey (REG)            print  "=== python", version,  "is  already registered! "           return      closekey (reg)       print  "*** unable to register!"       print  "*** you probably have another python  installation! "         if __name__ ==  "__main__":       registerpy ()

Show "Python 2.7 is already registered"

When you install Setuptools, you can automatically identify the python2.7.

Win7 is 64 reasons, when installing Python (32-bit), if you choose only for the current user, the above problems will not appear, if you choose all users, then use the above method to solve it.

Category: Python


This article is from the "Struggle Bar" blog, please be sure to keep this source http://lvnian.blog.51cto.com/7155281/1839549

Python Installation Mysql-python failure

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.