安装气流时出现“ cl.exe失败,退出状态为2”错误

时间:2019-01-13 06:18:30

标签: c++ visual-studio-2017 airflow cl.exe

设置
Windows 10
Python 3.6
Visual Studio 2017

要重新创建问题

$set SLUGIFY_USES_TEXT_UNIDECODE=yes
$export AIRFLOW_GPL_UNIDECODE=yes
$pip install apache-airflow

日志:

    .......
    building 'psutil._psutil_windows' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\psutil
    creating build\temp.win-amd64-3.6\Release\psutil\arch
    creating build\temp.win-amd64-3.6\Release\psutil\arch\windows
    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 -DPSUTIL_WINDOWS=1 -DPSUTIL_VERSION=442 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -Ic:\users\yash\appdata\local\programs\python\python36\include -Ic:\users\yash\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)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\Include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcpsutil/_psutil_windows.c /Fobuild\temp.win-amd64-3.6\Release\psutil/_psutil_windows.obj
    _psutil_windows.c
    c:\users\yash\appdata\local\temp\pip-install-j49ia0wj\psutil\psutil\arch\windows\ntextapi.h(166): error C2011: '_CLIENT_ID': 'struct' type redefinition
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winternl.h(80): note: see declaration of '_CLIENT_ID'
    c:\users\yash\appdata\local\temp\pip-install-j49ia0wj\psutil\psutil\arch\windows\ntextapi.h(172): error C2011: '_SYSTEM_THREAD_INFORMATION': 'struct' type redefinition
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winternl.h(286): note: see declaration of '_SYSTEM_THREAD_INFORMATION'
    c:\users\yash\appdata\local\temp\pip-install-j49ia0wj\psutil\psutil\arch/windows/inet_ntop.h(10): warning C4028: formal parameter 2 different from declaration
    psutil/_psutil_windows.c(246): warning C4244: '=': conversion from 'float' to 'ULONGLONG', possible loss of data
    psutil/_psutil_windows.c(880): warning C4267: '=': conversion from 'size_t' to 'DWORD', possible loss of data
    psutil/_psutil_windows.c(1445): warning C4267: '=': conversion from 'size_t' to 'ULONG', possible loss of data
    psutil/_psutil_windows.c(1446): warning C4267: '=': conversion from 'size_t' to 'ULONG', possible loss of data
    psutil/_psutil_windows.c(2111): warning C4312: 'type cast': conversion from 'int' to 'PVOID' of greater size
    psutil/_psutil_windows.c(2810): error C2039: 'ContextSwitches': is not a member of '_SYSTEM_THREAD_INFORMATION'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\winternl.h(286): note: see declaration of '_SYSTEM_THREAD_INFORMATION'
    psutil/_psutil_windows.c(2907): warning C4133: 'function': incompatible types - from 'MEMORY_BASIC_INFORMATION64 *' to 'PMEMORY_BASIC_INFORMATION'
    psutil/_psutil_windows.c(2935): warning C4047: '=': 'PVOID' differs in levels of indirection from 'ULONGLONG'
    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\yash\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Yash\\AppData\\Local\\Temp\\pip-install-j49ia0wj\\psutil\\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\Yash\AppData\Local\Temp\pip-record-_t13e7wl\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Yash\AppData\Local\Temp\pip-install-j49ia0wj\psutil\

我尝试过但无效的方法:
1.使用Visual Studio 2015
2.使用Python 3.7
3.安装Twisted-在python 3.6上安装
https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
4. pip install --upgrade setuptools

我真的很感谢任何建议或解决方案。

0 个答案:

没有答案