画中画|无法安装屏幕

时间:2019-01-13 00:12:59

标签: python pip screen

当我尝试通过输入python -m pip install screen安装屏幕时,出现此错误:

$ 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\

我已经成功安装了setuptool,但是错误仍然存​​在。

2 个答案:

答案 0 :(得分:0)

尽管我没有设法解决这个特定的问题,但我还是使用Pillow GrabScreen而不是screen来为我解决了!像魅力一样工作

答案 1 :(得分:0)

大多数情况下,由于您的环境中缺少c ++构建工具而导致发生此类问题。从Microsoft下载工具并安装。