Error when trying to Install Web3 using Python
Question:
Trying to install web3 in Python with the pip install command, it gets to Running setup.py install for cytoolz and then fails as follows:
I have searched many articles that suggest installing the Microsoft Visual C++ 14.0 using the Build Tools for Visual Studio, which I have done.
I have also copied the rc.exe and rc.dll from the C:Program Files (x86)Windows Kits10binx86 to the C:Program Files (x86)Microsoft Visual Studio folder.
None of these seem to have worked unfortunately.
I tried to install cytoolz on its own but it gives the same error below.
ERROR: Command errored out with exit status 1:
command: 'c:usersmcbaiappdatalocalprogramspythonpython39python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\setup.py'"'"'; __file__='"'"'C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersmcbaiAppDataLocalTemppip-record-tgqd_7wtinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersmcbaiAppDataLocalProgramsPythonPython39Includecytoolz'
cwd: C:UsersmcbaiAppDataLocalTemppip-install-745dmcikcytoolz_2a8cbc08ed71439fb6f4b92d63b43a98
Complete output (65 lines):
[1/5] Cythonizing cytoolz/utils.pyx
[2/5] Cythonizing cytoolz/dicttoolz.pyx
[3/5] Cythonizing cytoolz/functoolz.pyx
[4/5] Cythonizing cytoolz/itertoolz.pyx
[5/5] Cythonizing cytoolz/recipes.pyx
running install
C:UsersmcbaiAppDataLocalProgramsPythonPython39libsite-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9cytoolz
copying cytoolzcompatibility.py -> buildlib.win-amd64-3.9cytoolz
copying cytoolz_signatures.py -> buildlib.win-amd64-3.9cytoolz
copying cytoolz_version.py -> buildlib.win-amd64-3.9cytoolz
copying cytoolz__init__.py -> buildlib.win-amd64-3.9cytoolz
creating buildlib.win-amd64-3.9cytoolzcurried
copying cytoolzcurriedexceptions.py -> buildlib.win-amd64-3.9cytoolzcurried
copying cytoolzcurriedoperator.py -> buildlib.win-amd64-3.9cytoolzcurried
copying cytoolzcurried__init__.py -> buildlib.win-amd64-3.9cytoolzcurried
copying cytoolzdicttoolz.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzfunctoolz.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzitertoolz.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzrecipes.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzutils.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzcpython.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzdicttoolz.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzfunctoolz.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzitertoolz.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzrecipes.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzutils.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolz__init__.pxd -> buildlib.win-amd64-3.9cytoolz
creating buildlib.win-amd64-3.9cytoolztests
copying cytoolztestsdev_skip_test.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_compatibility.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_curried.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_curried_toolzlike.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_dev_skip_test.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_dicttoolz.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_docstrings.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_doctests.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_embedded_sigs.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_functoolz.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_inspect_args.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_itertoolz.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_none_safe.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_recipes.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_serialization.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_signatures.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_tlz.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_utils.py -> buildlib.win-amd64-3.9cytoolztests
running build_ext
creating buildtemp.win-amd64-3.9
creating buildtemp.win-amd64-3.9Release
creating buildtemp.win-amd64-3.9Releasecytoolz
"C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:UsersmcbaiAppDataLocalProgramsPythonPython39include -IC:UsersmcbaiAppDataLocalProgramsPythonPython39Include "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE" "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE" "-IC:Program Files (x86)Windows Kits10include10.0.22000.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program Files (x86)Windows Kits10include10.0.22000.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.22000.0um" "-IC:Program Files (x86)Windows Kits10include10.0.22000.0winrt" /Tccytoolz/dicttoolz.c /Fobuildtemp.win-amd64-3.9Releasecytoolz/dicttoolz.obj dicttoolz.c
"C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:UsersmcbaiAppDataLocalProgramsPythonPython39libs /LIBPATH:C:UsersmcbaiAppDataLocalProgramsPythonPython39 /LIBPATH:C:UsersmcbaiAppDataLocalProgramsPythonPython39PCbuildamd64 "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCLIBamd64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCLIBamd64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.22000.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows KitsNETFXSDK4.6.1libumx64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.22000.0umx64" /EXPORT:PyInit_dicttoolz buildtemp.win-amd64-3.9Releasecytoolz/dicttoolz.obj /OUT:buildlib.win-amd64-3.9cytoolzdicttoolz.cp39-win_amd64.pyd /IMPLIB:buildtemp.win-amd64-3.9Releasecytoolzdicttoolz.cp39-win_amd64.lib
dicttoolz.obj : warning LNK4197: export 'PyInit_dicttoolz' specified multiple times; using first specification
Creating library buildtemp.win-amd64-3.9Releasecytoolzdicttoolz.cp39-win_amd64.lib and object buildtemp.win-amd64-3.9Releasecytoolzdicttoolz.cp39-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1327: failure during running rc.exe
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit code 1327
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersmcbaiappdatalocalprogramspythonpython39python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\setup.py'"'"'; __file__='"'"'C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersmcbaiAppDataLocalTemppip-record-tgqd_7wtinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersmcbaiAppDataLocalProgramsPythonPython39Includecytoolz' Check the logs for full command output.
Answers:
Resolved: I removed anything Visual Studio related as well as build tools, reloaded VS and then installed the following build tools as per this article: https://stackoverflow.com/a/55575792/1612432
Trying to install web3 in Python with the pip install command, it gets to Running setup.py install for cytoolz and then fails as follows:
I have searched many articles that suggest installing the Microsoft Visual C++ 14.0 using the Build Tools for Visual Studio, which I have done.
I have also copied the rc.exe and rc.dll from the C:Program Files (x86)Windows Kits10binx86 to the C:Program Files (x86)Microsoft Visual Studio folder.
None of these seem to have worked unfortunately.
I tried to install cytoolz on its own but it gives the same error below.
ERROR: Command errored out with exit status 1:
command: 'c:usersmcbaiappdatalocalprogramspythonpython39python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\setup.py'"'"'; __file__='"'"'C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersmcbaiAppDataLocalTemppip-record-tgqd_7wtinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersmcbaiAppDataLocalProgramsPythonPython39Includecytoolz'
cwd: C:UsersmcbaiAppDataLocalTemppip-install-745dmcikcytoolz_2a8cbc08ed71439fb6f4b92d63b43a98
Complete output (65 lines):
[1/5] Cythonizing cytoolz/utils.pyx
[2/5] Cythonizing cytoolz/dicttoolz.pyx
[3/5] Cythonizing cytoolz/functoolz.pyx
[4/5] Cythonizing cytoolz/itertoolz.pyx
[5/5] Cythonizing cytoolz/recipes.pyx
running install
C:UsersmcbaiAppDataLocalProgramsPythonPython39libsite-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9cytoolz
copying cytoolzcompatibility.py -> buildlib.win-amd64-3.9cytoolz
copying cytoolz_signatures.py -> buildlib.win-amd64-3.9cytoolz
copying cytoolz_version.py -> buildlib.win-amd64-3.9cytoolz
copying cytoolz__init__.py -> buildlib.win-amd64-3.9cytoolz
creating buildlib.win-amd64-3.9cytoolzcurried
copying cytoolzcurriedexceptions.py -> buildlib.win-amd64-3.9cytoolzcurried
copying cytoolzcurriedoperator.py -> buildlib.win-amd64-3.9cytoolzcurried
copying cytoolzcurried__init__.py -> buildlib.win-amd64-3.9cytoolzcurried
copying cytoolzdicttoolz.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzfunctoolz.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzitertoolz.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzrecipes.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzutils.pyx -> buildlib.win-amd64-3.9cytoolz
copying cytoolzcpython.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzdicttoolz.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzfunctoolz.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzitertoolz.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzrecipes.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolzutils.pxd -> buildlib.win-amd64-3.9cytoolz
copying cytoolz__init__.pxd -> buildlib.win-amd64-3.9cytoolz
creating buildlib.win-amd64-3.9cytoolztests
copying cytoolztestsdev_skip_test.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_compatibility.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_curried.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_curried_toolzlike.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_dev_skip_test.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_dicttoolz.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_docstrings.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_doctests.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_embedded_sigs.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_functoolz.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_inspect_args.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_itertoolz.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_none_safe.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_recipes.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_serialization.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_signatures.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_tlz.py -> buildlib.win-amd64-3.9cytoolztests
copying cytoolzteststest_utils.py -> buildlib.win-amd64-3.9cytoolztests
running build_ext
creating buildtemp.win-amd64-3.9
creating buildtemp.win-amd64-3.9Release
creating buildtemp.win-amd64-3.9Releasecytoolz
"C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:UsersmcbaiAppDataLocalProgramsPythonPython39include -IC:UsersmcbaiAppDataLocalProgramsPythonPython39Include "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE" "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE" "-IC:Program Files (x86)Windows Kits10include10.0.22000.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program Files (x86)Windows Kits10include10.0.22000.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.22000.0um" "-IC:Program Files (x86)Windows Kits10include10.0.22000.0winrt" /Tccytoolz/dicttoolz.c /Fobuildtemp.win-amd64-3.9Releasecytoolz/dicttoolz.obj dicttoolz.c
"C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:UsersmcbaiAppDataLocalProgramsPythonPython39libs /LIBPATH:C:UsersmcbaiAppDataLocalProgramsPythonPython39 /LIBPATH:C:UsersmcbaiAppDataLocalProgramsPythonPython39PCbuildamd64 "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCLIBamd64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCLIBamd64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.22000.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows KitsNETFXSDK4.6.1libumx64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.22000.0umx64" /EXPORT:PyInit_dicttoolz buildtemp.win-amd64-3.9Releasecytoolz/dicttoolz.obj /OUT:buildlib.win-amd64-3.9cytoolzdicttoolz.cp39-win_amd64.pyd /IMPLIB:buildtemp.win-amd64-3.9Releasecytoolzdicttoolz.cp39-win_amd64.lib
dicttoolz.obj : warning LNK4197: export 'PyInit_dicttoolz' specified multiple times; using first specification
Creating library buildtemp.win-amd64-3.9Releasecytoolzdicttoolz.cp39-win_amd64.lib and object buildtemp.win-amd64-3.9Releasecytoolzdicttoolz.cp39-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1327: failure during running rc.exe
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit code 1327
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersmcbaiappdatalocalprogramspythonpython39python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\setup.py'"'"'; __file__='"'"'C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersmcbaiAppDataLocalTemppip-record-tgqd_7wtinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersmcbaiAppDataLocalProgramsPythonPython39Includecytoolz' Check the logs for full command output.
Resolved: I removed anything Visual Studio related as well as build tools, reloaded VS and then installed the following build tools as per this article: https://stackoverflow.com/a/55575792/1612432