简体   繁体   中英

PIP | Can't install screen

When I try to install screen by entering python -m pip install screen I get this error:

$ python -m pip install screen
Collecting screen
  Using cached https://files.pythonhosted.org/packages/a4/d2/68dacd66f28618462650e475f29663eb1f97cecdc3cf8f0881e52f425a3a/screen-1.0.1.tar.gz
Building wheels for collected packages: screen
  Running setup.py bdist_wheel for screen: started
  Running setup.py bdist_wheel for screen: finished with status 'error'
  Complete output from command C:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MrGrimod\\AppData\\Local\\Temp\\pip-install-z29mr6h3\\screen\\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 C:\Users\MrGrimod\AppData\Local\Temp\pip-wheel-ia8iysps --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\screen
  copying screen\compat.py -> build\lib.win-amd64-3.6\screen
  copying screen\old_str_util.py -> build\lib.win-amd64-3.6\screen
  copying screen\__init__.py -> build\lib.win-amd64-3.6\screen
  running build_ext
  building 'screen.str_util' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\source
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\include -IC:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\Include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcsource/str_util.c /Fobuild\temp.win-amd64-3.6\Release\source/str_util.obj
  str_util.c
  c:\users\mrgrimod\appdata\local\programs\python\python36\include\pyconfig.h(59): fatal error C1083: Datei (Include) kann nicht ge▒ffnet werden: "io.h": No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for screen
  Running setup.py clean for screen
Failed to build screen
Installing collected packages: screen
  Running setup.py install for screen: started
    Running setup.py install for screen: finished with status 'error'
    Complete output from command C:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MrGrimod\\AppData\\Local\\Temp\\pip-install-z29mr6h3\\screen\\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\MrGrimod\AppData\Local\Temp\pip-record-exrcd0r5\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\screen
    copying screen\compat.py -> build\lib.win-amd64-3.6\screen
    copying screen\old_str_util.py -> build\lib.win-amd64-3.6\screen
    copying screen\__init__.py -> build\lib.win-amd64-3.6\screen
    running build_ext
    building 'screen.str_util' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\source
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\include -IC:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\Include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcsource/str_util.c /Fobuild\temp.win-amd64-3.6\Release\source/str_util.obj
    str_util.c
    c:\users\mrgrimod\appdata\local\programs\python\python36\include\pyconfig.h(59): fatal error C1083: Datei (Include) kann nicht ge▒ffnet werden: "io.h": No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MrGrimod\\AppData\\Local\\Temp\\pip-install-z29mr6h3\\screen\\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\MrGrimod\AppData\Local\Temp\pip-record-exrcd0r5\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\MrGrimod\AppData\Local\Temp\pip-install-z29mr6h3\screen\

I already installed setuptool successfully, but the error is still there.

Although I didn't manage to solve this specific problem I solved it for me by using Pillow GrabScreen instead of screen! Works like a charm

most of the time, these kind of issues occurs due to c++ building tools are missing in your environment. download the tools from Microsoft and install.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM