【问题标题】:Win10: pip install gives error: Unable to find vcvarsall.bat when I want to install cx_FreezeWin10:pip install 给出错误:当我想安装 cx_Freeze 时找不到 vcvarsall.bat
【发布时间】: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.pytoolskey = "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


【解决方案1】:

可能不支持 Python 3.5 和 Microsoft Visual Studio 2013 的组合。编译器要求在WindowsCompilers page中说明:在python 3.5的情况下需要Visual C++ 14.0版(Visual Studio 2015)。

【讨论】:

    猜你喜欢
    • 2013-11-18
    • 2015-12-15
    • 2015-12-14
    • 2018-10-29
    • 2016-10-06
    • 2016-06-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多