2

any advice would be greatly appreciated. I have installed visual studio like it tells me in the error and I have also attempted to pip install this in a venv environment however its still not working I have included the full error message below.

The error message is a little long this is the last message it gives error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2 as mentioned I have already installed visual studio so I do not understand I have looked into it being a env variable that I need to create to no avalie it sounds like theirs a missing folder by the looks of the error, if so how do I go about fixing this?

ERROR: Command errored out with exit status 1:
       command: 'c:\users\carl-\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\carl-\\AppData\\Local\\Temp\\pip-install-pdkcfk2e\\lru-dict\\setup.py'"'"'; __file__='"'"'C:\\Users\\carl-\\AppData\\Local\\Temp\\pip-install-pdkcfk2e\\lru-dict\\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\carl-\AppData\Local\Temp\pip-wheel-gzs5afno' --python-tag cp37
           cwd: C:\Users\carl-\AppData\Local\Temp\pip-install-pdkcfk2e\lru-dict\
      Complete output (11 lines):
      running bdist_wheel
      running build
      running build_ext
      building 'lru' extension
      creating build
      creating build\temp.win-amd64-3.7
      creating build\temp.win-amd64-3.7\Release
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\users\carl-\appdata\local\programs\python\python37\include -Ic:\users\carl-\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" /Tclru.c /Fobuild\temp.win-amd64-3.7\Release\lru.obj
      lru.c
      c:\users\carl-\appdata\local\programs\python\python37\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
      ----------------------------------------
      ERROR: Failed building wheel for lru-dict
      Running setup.py clean for lru-dict
      Building wheel for cytoolz (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: 'c:\users\carl-\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\carl-\\AppData\\Local\\Temp\\pip-install-pdkcfk2e\\cytoolz\\setup.py'"'"'; __file__='"'"'C:\\Users\\carl-\\AppData\\Local\\Temp\\pip-install-pdkcfk2e\\cytoolz\\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\carl-\AppData\Local\Temp\pip-wheel-a6zbn7gs' --python-tag cp37
           cwd: C:\Users\carl-\AppData\Local\Temp\pip-install-pdkcfk2e\cytoolz\
      Complete output (55 lines):
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.7
      creating build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\compatibility.py -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\utils_test.py -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\_signatures.py -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\_version.py -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\__init__.py -> build\lib.win-amd64-3.7\cytoolz
      creating build\lib.win-amd64-3.7\cytoolz\curried
      copying cytoolz\curried\exceptions.py -> build\lib.win-amd64-3.7\cytoolz\curried
      copying cytoolz\curried\operator.py -> build\lib.win-amd64-3.7\cytoolz\curried
      copying cytoolz\curried\__init__.py -> build\lib.win-amd64-3.7\cytoolz\curried
      copying cytoolz\dicttoolz.pyx -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\functoolz.pyx -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\itertoolz.pyx -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\recipes.pyx -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\utils.pyx -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\cpython.pxd -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\dicttoolz.pxd -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\functoolz.pxd -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\itertoolz.pxd -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\recipes.pxd -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\utils.pxd -> build\lib.win-amd64-3.7\cytoolz
      copying cytoolz\__init__.pxd -> build\lib.win-amd64-3.7\cytoolz
      creating build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\dev_skip_test.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_compatibility.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_curried.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_curried_toolzlike.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_dev_skip_test.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_dicttoolz.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_docstrings.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_doctests.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_embedded_sigs.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_functoolz.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_inspect_args.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_itertoolz.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_none_safe.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_recipes.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_serialization.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_signatures.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_tlz.py -> build\lib.win-amd64-3.7\cytoolz\tests
      copying cytoolz\tests\test_utils.py -> build\lib.win-amd64-3.7\cytoolz\tests
      running build_ext
      building 'cytoolz.dicttoolz' extension
      creating build\temp.win-amd64-3.7
      creating build\temp.win-amd64-3.7\Release
      creating build\temp.win-amd64-3.7\Release\cytoolz
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\users\carl-\appdata\local\programs\python\python37\include -Ic:\users\carl-\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" /Tccytoolz/dicttoolz.c /Fobuild\temp.win-amd64-3.7\Release\cytoolz/dicttoolz.obj
      dicttoolz.c
      c:\users\carl-\appdata\local\programs\python\python37\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
      ----------------------------------------
      ERROR: Failed building wheel for cytoolz
      Running setup.py clean for cytoolz
    Failed to build lru-dict cytoolz
    Installing collected packages: lru-dict, cytoolz, eth-utils, attrdict, hexbytes, parsimonious, eth-abi, eth-keys, eth-keyfile, rlp, eth-rlp, eth-account, web3
      Running setup.py install for lru-dict ... error
        ERROR: Command errored out with exit status 1:
         command: 'c:\users\carl-\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\carl-\\AppData\\Local\\Temp\\pip-install-pdkcfk2e\\lru-dict\\setup.py'"'"'; __file__='"'"'C:\\Users\\carl-\\AppData\\Local\\Temp\\pip-install-pdkcfk2e\\lru-dict\\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\carl-\AppData\Local\Temp\pip-record-89q4z0xh\install-record.txt' --single-version-externally-managed --compile
             cwd: C:\Users\carl-\AppData\Local\Temp\pip-install-pdkcfk2e\lru-dict\
        Complete output (11 lines):
        running install
        running build
        running build_ext
        building 'lru' extension
        creating build
        creating build\temp.win-amd64-3.7
        creating build\temp.win-amd64-3.7\Release
        C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\users\carl-\appdata\local\programs\python\python37\include -Ic:\users\carl-\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" /Tclru.c /Fobuild\temp.win-amd64-3.7\Release\lru.obj
        lru.c
        c:\users\carl-\appdata\local\programs\python\python37\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
        error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
        ----------------------------------------
    ERROR: Command errored out with exit status 1: 'c:\users\carl-\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\carl-\\AppData\\Local\\Temp\\pip-install-pdkcfk2e\\lru-dict\\setup.py'"'"'; __file__='"'"'C:\\Users\\carl-\\AppData\\Local\\Temp\\pip-install-pdkcfk2e\\lru-dict\\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\carl-\AppData\Local\Temp\pip-record-89q4z0xh\install-record.txt' --single-version-externally-manag

ed --compile Check the logs for full command output.

TylerH
  • 20,799
  • 66
  • 75
  • 101
carl walters
  • 159
  • 1
  • 3
  • 11
  • 2
    It seems like you're using python3.7, can you try ```pip3 install ...``` instead of ```pip install ...``` – DUDANF Oct 08 '19 at 13:29
  • hummm thank you for the suggestion I just gave "pip3 install web3" ago but it resulted in the same error unfortunately. – carl walters Oct 08 '19 at 13:33
  • If I use pip3 does this also mean I need to downgrade my python version to 3? I just took a look at https://github.com/ethereum/web3.py and it says it suppports Python 3.6+ – carl walters Oct 08 '19 at 13:34
  • no pip3 is for any Python3+ be it 3.5 or 3.7. Also, you have python3.7 installed so shouldn't be a problem. – DUDANF Oct 08 '19 at 13:44
  • Thank you, I just gave it ago on python3.6 just in case 3.7 isnt working for web3. Would you happen to have any idear on how else I might fix the error? – carl walters Oct 08 '19 at 13:47
  • Im having a look. You also don't need VS Code installed since my docker doesn't have VS code. Do you have docker? – DUDANF Oct 08 '19 at 13:47
  • Can you actually run the command as admin? In mac/linux ```sudo pip install web3``` – DUDANF Oct 08 '19 at 13:49
  • https://github.com/pygraphviz/pygraphviz/issues/121#issuecomment-307357852 – DUDANF Oct 08 '19 at 13:49
  • @daudnadeem `pip` already seems to be correctly pointing to the version associated with `python 3.7`, so no need to run `pip3`. OP is also obviously on windows, so `sudo` commands will not work. The github link you have posted is a) for a completely different lib, b) a different error and c) has 200 downvotes and probably rather useless to fix an error where a certain header cannot be found – FlyingTeller Oct 08 '19 at 13:56
  • Thank you once again, ahh I see wont be using that respiratory so to make sure I understand are you saying it isnt somthing I can fix? Thanks – carl walters Oct 08 '19 at 14:09
  • Manged to get it working by install all of the VS packages thanks a lot! – carl walters Oct 08 '19 at 18:59

4 Answers4

3

just install cython

pip install cython #in the same environment
abinash_269
  • 361
  • 3
  • 6
2

The issue here is

c:\users\carl-\appdata\local\programs\python\python37\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory

What pip is doing here is downloading the web3 source and trying to compile it using the compiler that came with your visual studio in C:\Program Files (x86)\Microsoft Visual Studio

It fails, because it cannot find headers which come bundled with the Windows SDK (see also this post) which you can install using the Visual Studio Installer. Simply select "Modify" and then "Individual Components" and install the "Windows 10 SDK". That should solve your problem

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53
  • Thank you for the help, I just Modified visual studio and installed "Visual studio SDK" and Windows 10 SDK (10.0. 16299.0) however after restarting I am still getting the same error. Is their any other things from VS I should also try installing? Thanks – carl walters Oct 08 '19 at 14:12
  • For me, `io.h` is located in `C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt` after installing the `10.0.16299.0 SDK`, could you check if that folder exists for you as well? – FlyingTeller Oct 08 '19 at 14:35
  • ohhh how intresting yes it does! below is the code inside the io.h #pragma once #define _INC_IO #include – carl walters Oct 08 '19 at 15:21
  • 1
    Manged to get it working by installing just able everything inside VS Thanks! – carl walters Oct 08 '19 at 18:59
1

Not sure if my problem was the same, but downloading Microsoft C++ build tools worked for me

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30261897) – anand_v.singh Nov 05 '21 at 15:54
  • This was not a bad answer and worked for me. I would suggest to add the version of the build tools that worked for you and maybe other details like you need a microsoft account in order to access the download and add a link to the download form or page. – LeanMan Nov 18 '21 at 11:05
-4

On Windows 10, I tried to install Microsoft Visual C++ Build Tools, but that didn't solve the problem. So I installed a Linux-based system instead, used it as dual boot, and it works.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135