在Windows 10上,我尝试使用Python 3.5.0 | Anaconda 2.4.0(64位)安装cx_Freeze:
pip install cx_Freeze
但是,我收到了这个错误:
error: Unable to find vcvarsall.bat
这是错误以及错误上方和下方的一些行:
creating build\lib.win-amd64-3.5\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win-amd64-3.5\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win-amd64-3.5\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Failed building wheel for cx-Freeze
Running setup.py clean for cx-Freeze
Failed to build cx-Freeze
Installing collected packages: cx-Freeze
Running setup.py install for cx-Freeze ... error
Complete output from command c:\users\rachin_doug\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\RACHIN~1\\AppData\\Local\\Temp\\pip-build-sllgirs1\\cx-Freeze\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\RACHIN~1\AppData\Local\Temp\pip-7d4trlig-record\install-record.txt --single-version-externally-managed --compile:
和
creating build\lib.win-amd64-3.5\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win-amd64-3.5\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win-amd64-3.5\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\users\rachin_doug\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\RACHIN~1\\AppData\\Local\\Temp\\pip-build-sllgirs1\\cx-Freeze\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\RACHIN~1\AppData\Local\Temp\pip-7d4trlig-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\RACHIN~1\AppData\Local\Temp\pip-build-sllgirs1\cx-Freeze\
在我尝试安装cx_Freeze之前,我已经安装了Microsoft Visual Studio 2013。
我尝试了以下在互联网上发现的想法:
我修改了第241行的msvc9compiler.py
从toolskey = "VS%0.f0COMNTOOLS" % version
到toolskey = "VS120COMNTOOLS"
;
我在术语下创建了术语HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC
和新的字符串值(name = productdir,data ='vcvarsall.bat'的路径)。
在尝试了这些想法后,我仍然遇到了同样的错误。
答案 0 :(得分:0)
可能不支持Python 3.5和Microsoft Visual Studio 2013的组合。编译器要求在WindowsCompilers page中说明:在python 3.5的情况下,需要Visual C ++版本14.0(Visual Studio 2015)。