pip install web3 not installing

Question:

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:userscarl-appdatalocalprogramspythonpython37python.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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:Userscarl-AppDataLocalTemppip-wheel-gzs5afno' --python-tag cp37
           cwd: C:Userscarl-AppDataLocalTemppip-install-pdkcfk2elru-dict
      Complete output (11 lines):
      running bdist_wheel
      running build
      running build_ext
      building 'lru' extension
      creating build
      creating buildtemp.win-amd64-3.7
      creating buildtemp.win-amd64-3.7Release
      C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.23.28105binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:userscarl-appdatalocalprogramspythonpython37include -Ic:userscarl-appdatalocalprogramspythonpython37include "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.23.28105include" /Tclru.c /Fobuildtemp.win-amd64-3.7Releaselru.obj
      lru.c
      c:userscarl-appdatalocalprogramspythonpython37includepyconfig.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:userscarl-appdatalocalprogramspythonpython37python.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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:Userscarl-AppDataLocalTemppip-wheel-a6zbn7gs' --python-tag cp37
           cwd: C:Userscarl-AppDataLocalTemppip-install-pdkcfk2ecytoolz
      Complete output (55 lines):
      running bdist_wheel
      running build
      running build_py
      creating build
      creating buildlib.win-amd64-3.7
      creating buildlib.win-amd64-3.7cytoolz
      copying cytoolzcompatibility.py -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzutils_test.py -> buildlib.win-amd64-3.7cytoolz
      copying cytoolz_signatures.py -> buildlib.win-amd64-3.7cytoolz
      copying cytoolz_version.py -> buildlib.win-amd64-3.7cytoolz
      copying cytoolz__init__.py -> buildlib.win-amd64-3.7cytoolz
      creating buildlib.win-amd64-3.7cytoolzcurried
      copying cytoolzcurriedexceptions.py -> buildlib.win-amd64-3.7cytoolzcurried
      copying cytoolzcurriedoperator.py -> buildlib.win-amd64-3.7cytoolzcurried
      copying cytoolzcurried__init__.py -> buildlib.win-amd64-3.7cytoolzcurried
      copying cytoolzdicttoolz.pyx -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzfunctoolz.pyx -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzitertoolz.pyx -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzrecipes.pyx -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzutils.pyx -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzcpython.pxd -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzdicttoolz.pxd -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzfunctoolz.pxd -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzitertoolz.pxd -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzrecipes.pxd -> buildlib.win-amd64-3.7cytoolz
      copying cytoolzutils.pxd -> buildlib.win-amd64-3.7cytoolz
      copying cytoolz__init__.pxd -> buildlib.win-amd64-3.7cytoolz
      creating buildlib.win-amd64-3.7cytoolztests
      copying cytoolztestsdev_skip_test.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_compatibility.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_curried.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_curried_toolzlike.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_dev_skip_test.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_dicttoolz.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_docstrings.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_doctests.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_embedded_sigs.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_functoolz.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_inspect_args.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_itertoolz.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_none_safe.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_recipes.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_serialization.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_signatures.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_tlz.py -> buildlib.win-amd64-3.7cytoolztests
      copying cytoolzteststest_utils.py -> buildlib.win-amd64-3.7cytoolztests
      running build_ext
      building 'cytoolz.dicttoolz' extension
      creating buildtemp.win-amd64-3.7
      creating buildtemp.win-amd64-3.7Release
      creating buildtemp.win-amd64-3.7Releasecytoolz
      C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.23.28105binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:userscarl-appdatalocalprogramspythonpython37include -Ic:userscarl-appdatalocalprogramspythonpython37include "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.23.28105include" /Tccytoolz/dicttoolz.c /Fobuildtemp.win-amd64-3.7Releasecytoolz/dicttoolz.obj
      dicttoolz.c
      c:userscarl-appdatalocalprogramspythonpython37includepyconfig.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:userscarl-appdatalocalprogramspythonpython37python.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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:Userscarl-AppDataLocalTemppip-record-89q4z0xhinstall-record.txt' --single-version-externally-managed --compile
             cwd: C:Userscarl-AppDataLocalTemppip-install-pdkcfk2elru-dict
        Complete output (11 lines):
        running install
        running build
        running build_ext
        building 'lru' extension
        creating build
        creating buildtemp.win-amd64-3.7
        creating buildtemp.win-amd64-3.7Release
        C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.23.28105binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:userscarl-appdatalocalprogramspythonpython37include -Ic:userscarl-appdatalocalprogramspythonpython37include "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.23.28105include" /Tclru.c /Fobuildtemp.win-amd64-3.7Releaselru.obj
        lru.c
        c:userscarl-appdatalocalprogramspythonpython37includepyconfig.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:userscarl-appdatalocalprogramspythonpython37python.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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:Userscarl-AppDataLocalTemppip-record-89q4z0xhinstall-record.txt' --single-version-externally-manag

ed –compile Check the logs for full command output.

Asked By: carl walters

||

Answers:

The issue here is

c:userscarl-appdatalocalprogramspythonpython37includepyconfig.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

Answered By: FlyingTeller

just install cython

pip install cython #in the same environment
Answered By: abinash_269

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

Answered By: JC_bigstacks_868

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.

Answered By: Tomás Telvino
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.