pip安裝包報錯:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat


pip安裝包報錯:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

Windows7下pip安裝包報錯:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat

在Windows7x64下使用pip安裝包的時候提示報錯:Microsoft Visual C++ 9.0 is required  (Unable to find vcvarsall.bat)

如果你的系統沒有VS2008的話,可以安裝一個Micorsoft Visual C++ Compiler for Python 2.7的包,如果安裝了更高版本的VS的話,可以通過修改“C:\Python27\Lib\distutils\msvc9compiler.py”文件來解決這個問題。

可以通過注冊表查看你安裝的版本號:

然后修改文件中的“find_vcvarsall(version)”函數,添加一句“version = 10.0”;10.0為你安裝的版本號。

 

[python]  view plain  copy
 
 在CODE上查看代碼片派生到我的代碼片
  1. def find_vcvarsall(version):  
  2.     """Find the vcvarsall.bat file 
  3.  
  4.     At first it tries to find the productdir of VS 2008 in the registry. If 
  5.     that fails it falls back to the VS90COMNTOOLS env var. 
  6.     """  
  7.     version = 10.0  
  8.     vsbase = VS_BASE % version  
  9.     try:  
  10.         productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,  
  11.                                    "productdir")  
  12.     except KeyError:  
  13.         productdir = None  

但這個問題解決之后還是不能安裝,又遇到問題:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':no such file or directory

 

下載安裝包安裝又遇到:Python Version 2.7 required which was not found in the registry

最后直接去下載64位的安裝包就OK了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM