0

I have been trying to install apache-airflow on my windows 10 machine but i couldn't. Initially, i got the "Microsoft Visual C++ 14.0 missing" error, then i installed it through visual studio installer. Now i am getting some new error:


Installing collected packages: psutil, pygments, docutils, lockfile, python-daemon, text-unidecode, python-slugify, python-nvd3, idna, urllib3, certifi, chardet, requests, setproctitle, tabulate, monotonic, tenacity, thrift, unicodecsv, zope.deprecation, apache-airflow
  Found existing installation: psutil 5.4.8
    Uninstalling psutil-5.4.8:
      Successfully uninstalled psutil-5.4.8
  Running setup.py install for psutil ... error
    Complete output from command c:\users\farhath\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\farhaI~1\\AppData\\Local\\Temp\\pip-install-6xcc7tns\\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\farhaI~1\AppData\Local\Temp\pip-record-8gjefaoy\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\psutil
    copying psutil\_common.py -> build\lib.win-amd64-3.7\psutil
    copying psutil\_compat.py -> build\lib.win-amd64-3.7\psutil
    copying psutil\_psbsd.py -> build\lib.win-amd64-3.7\psutil
    copying psutil\_pslinux.py -> build\lib.win-amd64-3.7\psutil
    copying psutil\_psosx.py -> build\lib.win-amd64-3.7\psutil
    copying psutil\_psposix.py -> build\lib.win-amd64-3.7\psutil
    copying psutil\_pssunos.py -> build\lib.win-amd64-3.7\psutil
    copying psutil\_pswindows.py -> build\lib.win-amd64-3.7\psutil
    copying psutil\__init__.py -> build\lib.win-amd64-3.7\psutil
    creating build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\runner.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_bsd.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_linux.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_memory_leaks.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_misc.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_osx.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_posix.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_process.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_sunos.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_system.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\test_windows.py -> build\lib.win-amd64-3.7\psutil\tests
    copying psutil\tests\__init__.py -> build\lib.win-amd64-3.7\psutil\tests
    running build_ext
    building 'psutil._psutil_windows' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\psutil
    creating build\temp.win-amd64-3.7\Release\psutil\arch
    creating build\temp.win-amd64-3.7\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\farhath\appdata\local\programs\python\python37\include -Ic:\users\farhath\appdata\local\programs\python\python37\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" "-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.7\Release\psutil/_psutil_windows.obj
    _psutil_windows.c
    c:\users\farhath\appdata\local\temp\pip-install-6xcc7tns\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\farhath\appdata\local\temp\pip-install-6xcc7tns\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\farhath\appdata\local\temp\pip-install-6xcc7tns\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

    ----------------------------------------
  Rolling back uninstall of psutil
Command "c:\users\farhath\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\farhaI~1\\AppData\\Local\\Temp\\pip-install-6xcc7tns\\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\farhaI~1\AppData\Local\Temp\pip-record-8gjefaoy\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\farhaI~1\AppData\Local\Temp\pip-install-6xcc7tns\psutil\

I tried re-installing the visual studio, still no luck, i don't know what else to do. Can you please suggest some solution ?

SpaceyBot
  • 482
  • 1
  • 4
  • 20
  • 1
    The C code of the module seems to have a bug. Have you tried to install an older version? – Klaus D. Dec 11 '18 at 13:21
  • yes, i have tried "1.10.1rc2" and i got exactly the same error @KlausD. and for the version < 1.10, am getting this weird error:
    
     Traceback (most recent call last):
          File "", line 1, in 
          File "C:\Users\farhaI~1\AppData\Local\Temp\pip-install-aayt2qim\apache-airflow\setup.py", line 124
            async = [
                  ^
        SyntaxError: invalid syntax
    
    Command "python setup.py egg_info" failed with error code 1 in C:\Users\farhaI~1\AppData\Local\Temp\pip-install-aayt2qim\apache-airflow\
    
    – SpaceyBot Dec 11 '18 at 13:32
  • 1
    Please note that Apache Airflow is documented to be working with Python 2.7, 3.4 and 3.5, not with 3.7. – Klaus D. Dec 11 '18 at 13:37
  • Thanks, That solved it... :) @KlausD. – SpaceyBot Dec 12 '18 at 06:46

1 Answers1

2

Just for people that find this Stack Overflow post via googling, Apache Airflow currently supports Python 3.7 (but it didn't when this question was originally asked).

To fix the mentioned "Microsoft Visual C++ 14.0 is required" error, you need to install the Windows 10 SDK for Desktop C++ as mentioned here. Don't forget to either close/reopen your terminal or run the refreshenv command afterwards.

Will
  • 2,086
  • 23
  • 30