本文介绍了在Windows 10 Anaconda上安装Apache-Airflow时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的anaconda env(python 3.6)上安装apache-airflow [all_dbs]软件包,但在尝试安装psutil时却遇到相同的错误。我已经尝试过重新安装2015和2017 Microsoft构建工具,但无法解决问题。

I'm trying to install apache-airflow[all_dbs] package on my anaconda env (python 3.6) but I keep getting the same error when it tries to install psutil. I already tried reinstalling 2015 and 2017 microsoft build tools but it didn't fix the problem.

这是我在尝试安装软件包时收到的消息:

This is the message that I'm getting when trying to install the package:

Running setup.py install for psutil ... error
Complete output from command c:\users\pedrodaumas\anaconda3\envs\env36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\PEDROD~1\\AppData\\Local\\Temp\\pip-install-lkz40_ke\\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\PEDROD~1\AppData\Local\Temp\pip-record-a4lg57a9\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\psutil
copying psutil\_common.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_compat.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psbsd.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pslinux.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psosx.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_psposix.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pssunos.py -> build\lib.win-amd64-3.6\psutil
copying psutil\_pswindows.py -> build\lib.win-amd64-3.6\psutil
copying psutil\__init__.py -> build\lib.win-amd64-3.6\psutil
creating build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\runner.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_bsd.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_linux.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_memory_leaks.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_misc.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_osx.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_posix.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_process.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_sunos.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_system.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\test_windows.py -> build\lib.win-amd64-3.6\psutil\tests
copying psutil\tests\__init__.py -> build\lib.win-amd64-3.6\psutil\tests
running build_ext
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\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPSUTIL_WINDOWS=1 -DPSUTIL_VERSION=442 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -Ic:\users\pedrodaumas\anaconda3\envs\env36\include -Ic:\users\pedrodaumas\anaconda3\envs\env36\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-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\cppwinrt" /Tcpsutil/_psutil_windows.c /Fobuild\temp.win-amd64-3.6\Release\psutil/_psutil_windows.obj
_psutil_windows.c
c:\users\pedrodaumas\appdata\local\temp\pip-install-lkz40_ke\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\pedrodaumas\appdata\local\temp\pip-install-lkz40_ke\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\pedrodaumas\appdata\local\temp\pip-install-lkz40_ke\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\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

----------------------------------------
Command "c:\users\pedrodaumas\anaconda3\envs\env36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\PEDROD~1\\AppData\\Local\\Temp\\pip-install-lkz40_ke\\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\PEDROD~1\AppData\Local\Temp\pip-record-a4lg57a9\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in C:\Users\PEDROD~1\AppData\Local\Temp\pip-install-lkz40_ke\psutil\


推荐答案

除了默认设置之外,我还通过重新安装了带有 C ++ / CLI支持和用于桌面的VC ++ 2015.3 v14.00(v140)工具集选项的Build Tools 2017,可以解决此错误!

I was able to fix this bug by reinstalling Build Tools 2017 with the options "C++/CLI support" and "VC++ 2015.3 v14.00 (v140) toolset for desktop" checked in addition to the defaults!

这篇关于在Windows 10 Anaconda上安装Apache-Airflow时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 16:13