pip install cx_Freeze 命令不起作用
Posted
技术标签:
【中文标题】pip install cx_Freeze 命令不起作用【英文标题】:pip install cx_Freeze command not working 【发布时间】:2019-06-19 03:09:18 【问题描述】:pip install cx_Freeze
给出这个错误:-
Collecting cx_Freeze
Using cached https://files.pythonhosted.org/packages/5f/16/eab51d6571dfec2554248cb027c51babd04d97f594ab6359e0707361297d/cx_Freeze-5.1.1.tar.gz
Installing collected packages: cx-Freeze
Running setup.py install for cx-Freeze ... error
ERROR: Complete output from command 'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-y2cpdbhl\\cx-Freeze\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alok\AppData\Local\Temp\pip-record-7yj276ze\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\finder.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\freezer.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\hooks.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\macdist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\main.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\setupwriter.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\windist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\__init__.py -> build\lib.win32-3.7\cx_Freeze
creating build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\Console.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\ConsoleSetLibPath.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLib.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLibSource.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\__startup__.py -> build\lib.win32-3.7\cx_Freeze\initscripts
creating build\lib.win32-3.7\cx_Freeze\samples
creating build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_1.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_2.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
creating build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\asmodule.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
creating build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\matplotlib_eg.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
creating build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\test_openpyxl.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\PyQt4app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\PyQt5app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
creating build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\relimport.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
creating build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\Config.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\ServiceHandler.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\service
creating build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\hello.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
creating build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\SimpleTkApp.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
creating build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\wxapp.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
creating build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'c:\users\alok\appdata\local\programs\python\python3 error: Microsoft Visual C++ 14.0 is required. G;__file__='"'"'C:soft Visual C++ Build Tools": https://visualstudio.cpdbhl\\cx-Freezenloads/ open)(__file__); ---------------------------------------- ;f.close();exec(cERROR: Command "'c:\users\alok\appdata\local\prograrecord 'C:\Users\7-32\python.exe' -u -c 'import setuptools, tokenize\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-y2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"',code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"')ompile(code, __file__, '"'"'exec'"'"'))' install --Alok\AppData\Local\Temp\pip-record-7yj276ze\installngle-version-externally-managed --compile" failed win C:\Users\Alok\AppData\Local\Temp\pip-install-y2c
pip 安装***
然后为32位系统下载python3.7的cx_Freeze 然后在该路径中使用 cmd pip install cx_Freeze-5.1.1-cp37-cp37m-win32.whl
1.)pip install cx_Freeze
2.)pip 安装*** pip install cx_Freeze-5.1.1-cp37-cp37m-win32.whl
当我点击链接时,当我尝试运行命令 pip install cx_Freeze 时,它会导致安装 .rar 文件,然后它会给出以下错误,
Running setup.py install for cx-Freeze ... error
ERROR: Complete output from command 'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-5ojtpx8i\\cx-Freeze\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alok\AppData\Local\Temp\pip-record-9oe_iyi5\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\finder.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\freezer.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\hooks.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\macdist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\main.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\setupwriter.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\windist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\__init__.py -> build\lib.win32-3.7\cx_Freeze
creating build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\Console.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\ConsoleSetLibPath.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLib.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLibSource.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\__startup__.py -> build\lib.win32-3.7\cx_Freeze\initscripts
creating build\lib.win32-3.7\cx_Freeze\samples
creating build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_1.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_2.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
creating build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\asmodule.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
creating build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\matplotlib_eg.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
creating build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\test_openpyxl.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\PyQt4app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\PyQt5app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
creating build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\relimport.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
creating build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\Config.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\ServiceHandler.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\service
creating build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\hello.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
creating build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\SimpleTkApp.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
creating build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\wxapp.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
creating build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-5ojtpx8i\\cx-Freeze\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alok\AppData\Local\Temp\pip-record-9oe_iyi5\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Alok\AppData\Local\Temp\pip-install-5ojtpx8i\cx-Freeze\
【问题讨论】:
当我点击链接时 请重新组织或更确切地说是结构化并正确格式化您的问题。 这能回答你的问题吗? Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat) 【参考方案1】:您的系统中没有 Microsoft Visual C++ 14.0。所以首先从官方网站安装这个 - https://visualstudio.microsoft.com/downloads/
之后执行以下步骤 -
pip 安装***
然后根据你的python版本和windows版本到以下链接下载cx_Freeze轮文件:https://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze
在你的情况下,我可以看到 python 版本 - 3.7 和 32 位 Windows 系统
为此,您必须从上面的链接下载此 .whl -> cx_Freeze‑5.1.1‑cp37‑cp37m‑win32.whl
然后在下载后将该文件保存到任何文件夹并在命令中转到该文件夹执行 -
pip install cx_Freeze‑5.1.1‑cp37‑cp37m‑win32.whl
我希望这对你有用。
【讨论】:
以上是关于pip install cx_Freeze 命令不起作用的主要内容,如果未能解决你的问题,请参考以下文章
pip命令提示unknow or unsupported command install解决方法
做“sudo easy install pip”时“找不到命令”
python -m pip install --upgrade pip 升级不成功问题
python3安装pandas执行pip3 install pandas命令后卡住不动的问题及安装scipysklearn库的numpy.distutils.system_info.NotFound(