Cygwin上的cx_freeze安装失败

时间:2018-02-01 21:24:33

标签: python bash pip cygwin cx-freeze

我正在尝试使用命令python -m pip install cx_freeze --update在Cygwin上安装cx_freeze,我收到以下错误:

alice@Phoenix /cygdrive/c/cx_freeze/anthony_tuininga-cx_freeze-e1ba6ec6eaad
$ python3 -m pip install cx_freeze
Collecting cx_freeze
  Using cached cx_Freeze-5.1.1.tar.gz
Installing collected packages: cx-freeze
  Running setup.py install for cx-freeze ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4jp8deaw/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 /tmp/pip-klbzdd9a-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.cygwin-2.9.0-x86_64-3.6
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/common.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/dist.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/finder.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/freezer.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/hooks.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/macdist.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/main.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/setupwriter.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/windist.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    copying cx_Freeze/__init__.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/Console.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/ConsoleSetLibPath.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/SharedLib.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/SharedLibSource.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/initscripts
    copying cx_Freeze/initscripts/__startup__.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/initscripts
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/advanced
    copying cx_Freeze/samples/advanced/advanced_1.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/advanced
    copying cx_Freeze/samples/advanced/advanced_2.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/advanced
    copying cx_Freeze/samples/advanced/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/advanced
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/asmodule
    copying cx_Freeze/samples/asmodule/asmodule.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/asmodule
    copying cx_Freeze/samples/asmodule/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/asmodule
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/matplotlib
    copying cx_Freeze/samples/matplotlib/matplotlib_eg.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/matplotlib
    copying cx_Freeze/samples/matplotlib/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/matplotlib
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/openpyxl
    copying cx_Freeze/samples/openpyxl/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/openpyxl
    copying cx_Freeze/samples/openpyxl/test_openpyxl.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/openpyxl
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/PyQt4
    copying cx_Freeze/samples/PyQt4/PyQt4app.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/PyQt4
    copying cx_Freeze/samples/PyQt4/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/PyQt4
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/PyQt5
    copying cx_Freeze/samples/PyQt5/PyQt5app.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/PyQt5
    copying cx_Freeze/samples/PyQt5/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/PyQt5
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/relimport
    copying cx_Freeze/samples/relimport/relimport.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/relimport
    copying cx_Freeze/samples/relimport/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/relimport
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/service
    copying cx_Freeze/samples/service/Config.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/service
    copying cx_Freeze/samples/service/ServiceHandler.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/service
    copying cx_Freeze/samples/service/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/service
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/simple
    copying cx_Freeze/samples/simple/hello.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/simple
    copying cx_Freeze/samples/simple/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/simple
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/Tkinter
    copying cx_Freeze/samples/Tkinter/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/Tkinter
    copying cx_Freeze/samples/Tkinter/SimpleTkApp.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/Tkinter
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/wx
    copying cx_Freeze/samples/wx/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/wx
    copying cx_Freeze/samples/wx/wxapp.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/wx
    creating build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/zope
    copying cx_Freeze/samples/zope/qotd.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/zope
    copying cx_Freeze/samples/zope/setup.py -> build/lib.cygwin-2.9.0-x86_64-3.6/cx_Freeze/samples/zope
    running build_ext
    building 'cx_Freeze.util' extension
    creating build/temp.cygwin-2.9.0-x86_64-3.6
    creating build/temp.cygwin-2.9.0-x86_64-3.6/source
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.6.4-1.x86_64/build=/usr/src/debug/python3-3.6.4-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.6.4-1.x86_64/src/Python-3.6.4=/usr/src/debug/python3-3.6.4-1 -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.6.4-1.x86_64/build=/usr/src/debug/python3-3.6.4-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.6.4-1.x86_64/src/Python-3.6.4=/usr/src/debug/python3-3.6.4-1 -I/usr/include/python3.6m -c source/util.c -o build/temp.cygwin-2.9.0-x86_64-3.6/source/util.o
    source/util.c:6:10: fatal error: Python.h: No such file or directory
     #include <Python.h>
              ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4jp8deaw/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 /tmp/pip-klbzdd9a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-4jp8deaw/cx-freeze/

我的python版本是3.6.4,我删除了所有其他版本。 我首先手动下载了.exe但由于cxfreeze仍然是“未找到的命令”而无法正常工作,所以我尝试使用this(在我目前进入的目录中提取)。我有两个Python.h文件,一个位于我的Python 36文件夹中,另一个位于Appdata中。

我也使用Cygwin安装程序安装python3-devel,但是当我尝试pip install python3.x-dev时,pip会返回以下错误:

   Could not find a version that satisfies the requirement python3.x-dev (from versions: )
No matching distribution found for python3.x-dev

我认为这可能是因为我的pip版本,但我有最新版本:

pip 9.0.1 from /usr/lib/python3.6/site-packages/pip-9.0.1-py3.6.egg (python 3.6)

我已经尝试了所有关于cx_freeze的内容但是我必须在这里找到一些东西......

感谢您的帮助!

0 个答案:

没有答案