【发布时间】:2016-09-18 17:08:38
【问题描述】:
在 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'的路径)。
在尝试了这些想法后,我仍然遇到同样的错误。
【问题讨论】:
-
uninstall
cx_Freeze with Python 3.5.0 |Anaconda 2.4.0 (64-bit)进行磁盘清理,重新启动并重新安装它,除非您 100% 确定自己在做什么,否则不要修改编译器
标签: python python-3.x batch-file pip cx-freeze