Python安装模块常见错误

- pip instal MySQL-python 出现错误解决办法

  1. _mysql.c(42) : fatal error C1083: Cannot open include file: ‘config-win.h’:no such file or directory
  2. C:\Users\Administrator\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,’final’,1) -D__version__=1.2.5 “-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include” -II:\Python27\include -II:\Python27\PC /Tc_mysql.c /Fobuild\temp.win32-2.7\Release_mysql.obj /Zl
  3. Python Version 2.7 required which was not found in the registry
  4. Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

解决方法如下:

1) 安装mysql connector, 可根据系统版本选择安装32位或64位的, 下载地址:
http://dev.mysql.com/downloads/connector/c/6.0.html#downloads
2) 安装Microsoft Visual C++ Compiler for Python 2.7,要是安装mysql-python需要乃至vc的一些运行库,下载地址:
http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
3)手动安装 MySQL-python-1.2.3.win-amd64-py2.7.exe
http://www.codegood.com/archives/129

- Cannot uninstall ‘chardet’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
解决方法如下:sudo pip install –ignore-installed chardet

你可能感兴趣的:(python)