我正在尝试安装 pywinpty,但出现以下错误

时间:2021-05-05 11:20:39

标签: python linux python-2.7 pip pywin

安装pywinpty时出现以下错误

<块引用>

收集 https://files.pythonhosted.org/packages/b0/2c/11676105f51a7718316cd74186630f4a4cb0efa3530ebf3cfbe0b72e35cb/pywinpty-1.0.1.tar.gz 使用缓存 https://files.pythonhosted.org/packages/b0/2c/11676105f51a7718316cd74186630f4a4cb0efa3530ebf3cfbe0b72e35cb/pywinpty-1.0.1.tar.gz 命令 python setup.py egg_info 的完整输出: 回溯(最近一次调用最后一次): 文件“”,第 1 行,在 IOError: [Errno 2] 没有那个文件或目录:'/tmp/pip-ScCf1b-build/setup.py'

---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-ScCf1b-build/

现在我在使用命令 pip install pywinpty==0.5.7

安装时遇到以下错误
Collecting pywinpty==0.5.7
  Using cached https://files.pythonhosted.org/packages/5d/97/8e43c2152a638cdb83d45644eb125c752abe67249f94bb3e3e29b0709685/pywinpty-0.5.7.tar.gz
Requirement already satisfied: backports.shutil_which; python_version < "3.0" in /opt/virtualenvs/certerminal/lib/python2.7/site-packages (from pywinpty==0.5.7)
Building wheels for collected packages: pywinpty
  Running setup.py bdist_wheel for pywinpty ... error
  Complete output from command /opt/virtualenvs/certerminal/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-CI2oGR/pywinpty/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpYI7Uslpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/winpty
  copying winpty/__init__.py -> build/lib.linux-x86_64-2.7/winpty
  copying winpty/ptyprocess.py -> build/lib.linux-x86_64-2.7/winpty
  copying winpty/winpty_wrapper.py -> build/lib.linux-x86_64-2.7/winpty
  creating build/lib.linux-x86_64-2.7/winpty/_winpty
  copying winpty/_winpty/__init__.py -> build/lib.linux-x86_64-2.7/winpty/_winpty
  creating build/lib.linux-x86_64-2.7/winpty/tests
  copying winpty/tests/__init__.py -> build/lib.linux-x86_64-2.7/winpty/tests
  copying winpty/tests/test_cywinpty.py -> build/lib.linux-x86_64-2.7/winpty/tests
  copying winpty/tests/test_ptyprocess.py -> build/lib.linux-x86_64-2.7/winpty/tests
  copying winpty/tests/test_winpty_wrapper.py -> build/lib.linux-x86_64-2.7/winpty/tests
  running build_ext
  building 'winpty.cywinpty' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/winpty
  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c winpty/cywinpty.c -o build/temp.linux-x86_64-2.7/winpty/cywinpty.o
  winpty/cywinpty.c:628:21: fatal error: Windows.h: No such file or directory
   #include "Windows.h"
                       ^
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for pywinpty
  Running setup.py clean for pywinpty
Failed to build pywinpty
Installing collected packages: pywinpty
  Running setup.py install for pywinpty ... error
    Complete output from command /opt/virtualenvs/certerminal/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-CI2oGR/pywinpty/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-n18o4q-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/virtualenvs/certerminal/include/site/python2.7/pywinpty:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/winpty
    copying winpty/__init__.py -> build/lib.linux-x86_64-2.7/winpty
    copying winpty/ptyprocess.py -> build/lib.linux-x86_64-2.7/winpty
    copying winpty/winpty_wrapper.py -> build/lib.linux-x86_64-2.7/winpty
    creating build/lib.linux-x86_64-2.7/winpty/_winpty
    copying winpty/_winpty/__init__.py -> build/lib.linux-x86_64-2.7/winpty/_winpty
    creating build/lib.linux-x86_64-2.7/winpty/tests
    copying winpty/tests/__init__.py -> build/lib.linux-x86_64-2.7/winpty/tests
    copying winpty/tests/test_cywinpty.py -> build/lib.linux-x86_64-2.7/winpty/tests
    copying winpty/tests/test_ptyprocess.py -> build/lib.linux-x86_64-2.7/winpty/tests
    copying winpty/tests/test_winpty_wrapper.py -> build/lib.linux-x86_64-2.7/winpty/tests
    running build_ext
    building 'winpty.cywinpty' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/winpty
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c winpty/cywinpty.c -o build/temp.linux-x86_64-2.7/winpty/cywinpty.o
    winpty/cywinpty.c:628:21: fatal error: Windows.h: No such file or directory
     #include "Windows.h"
                         ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/opt/virtualenvs/certerminal/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-CI2oGR/pywinpty/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-n18o4q-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/virtualenvs/certerminal/include/site/python2.7/pywinpty" failed with error code 1 in /tmp/pip-build-CI2oGR/pywinpty/

0 个答案:

没有答案