2015-09-18 22 views
0

我想通過pip mysql安裝python 3.5。我發現我有 「C:\ Program Files(x86)\ Microsoft Visual Studio 9.0 \ VC \ vcvarsall.bat」 中缺少的文件vcvarsall.bat,但我不知道如何修改istall腳本以指向vcvarsall.bat建立'_mysql'擴展錯誤:無法找到vcvarsall.bat

這裏是安裝的輸出。我試過解決方案,我已經安裝了Express 8,Windows SDK,但似乎沒有任何幫助。

 
PS C:\Python35\Scripts> .\pip.exe install mysql 

Collecting mysql 

    Downloading mysql-0.0.1.tar.gz 

Collecting MySQL-python (from mysql) 

    Downloading MySQL-python-1.2.5.zip (108kB) 

    100% |################################| 110kB 866kB/s 

Installing collected packages: MySQL-python, mysql 

    Running setup.py install for MySQL-python 

    Complete output from command 

    c:\python35\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\Arthur\\AppData\\Local\\Temp\\pip-build t876fqxc\\MySQL-pyth 
    n\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Arthur\AppData\Local\Temp 
    pip-ohodnfbo-record\install-record.txt --single-version-externally-managed -- 

compile: 

    running install 
    running build 
    running build_py 
    creating build 
    creating build\lib.win-amd64-3.5 
    copying _mysql_exceptions.py -> build\lib.win-amd64-3.5 
    creating build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb 
    creating build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    running build_ext 
    building '_mysql' extension 
    error: Unable to find vcvarsall.bat 

UPDATE。在我將它的一個副本放入VC express的bin文件夾後,vsvarsall.bat錯誤消失了。

但現在我得到這個錯誤

 
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -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:\ 
hon35\include -Ic:\python35\include /Tc_mysql.c /Fobuild\temp.win-amd64-3.5\Release\_mysql.obj /Zl 

error: command '**cl.exe**' failed: No such file or directory 

但是當我把cl.exe時副本的Windows文件夾中我得到這個錯誤:

<pre> 
command 'C:\\WINDOWS\\cl.exe' failed with exit status -1073741515 
</pre> 

凡PIP安裝腳本所在?

Sovled

After I installed Microsoft Community Edition, now I have in 
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin 

cl.exe時,對我的AMD64位機

+1

可能重複的[錯誤:無法找到vcvarsall.bat](http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat) – Andy

回答

1

嘗試pymysql上編譯爲Python 3.5模塊工作。 https://github.com/PyMySQL/PyMySQL

它是純粹的Python,所以你不需要擔心構建任何東西來使它工作。我已經使用了它們,它們都適合我。

相關問題