Search code examples
pythonpipweb3py

Error when trying to Install Web3 using Python


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 Kits\10\bin\x86 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:\users\mcbai\appdata\local\programs\python\python39\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\mcbai\AppData\Local\Temp\pip-record-tgqd_7wt\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mcbai\AppData\Local\Programs\Python\Python39\Include\cytoolz'
         cwd: C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_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:\Users\mcbai\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install.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 build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\compatibility.py -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\_signatures.py -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\_version.py -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\__init__.py -> build\lib.win-amd64-3.9\cytoolz
    creating build\lib.win-amd64-3.9\cytoolz\curried
    copying cytoolz\curried\exceptions.py -> build\lib.win-amd64-3.9\cytoolz\curried
    copying cytoolz\curried\operator.py -> build\lib.win-amd64-3.9\cytoolz\curried
    copying cytoolz\curried\__init__.py -> build\lib.win-amd64-3.9\cytoolz\curried
    copying cytoolz\dicttoolz.pyx -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\functoolz.pyx -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\itertoolz.pyx -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\recipes.pyx -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\utils.pyx -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\cpython.pxd -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\dicttoolz.pxd -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\functoolz.pxd -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\itertoolz.pxd -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\recipes.pxd -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\utils.pxd -> build\lib.win-amd64-3.9\cytoolz
    copying cytoolz\__init__.pxd -> build\lib.win-amd64-3.9\cytoolz
    creating build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\dev_skip_test.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_compatibility.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_curried.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_curried_toolzlike.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_dev_skip_test.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_dicttoolz.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_docstrings.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_doctests.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_embedded_sigs.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_functoolz.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_inspect_args.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_itertoolz.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_none_safe.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_recipes.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_serialization.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_signatures.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_tlz.py -> build\lib.win-amd64-3.9\cytoolz\tests
    copying cytoolz\tests\test_utils.py -> build\lib.win-amd64-3.9\cytoolz\tests
    running build_ext
    creating build\temp.win-amd64-3.9
    creating build\temp.win-amd64-3.9\Release
    creating build\temp.win-amd64-3.9\Release\cytoolz
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\mcbai\AppData\Local\Programs\Python\Python39\include -IC:\Users\mcbai\AppData\Local\Programs\Python\Python39\Include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" /Tccytoolz/dicttoolz.c /Fobuild\temp.win-amd64-3.9\Release\cytoolz/dicttoolz.obj    dicttoolz.c
    "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\mcbai\AppData\Local\Programs\Python\Python39\libs /LIBPATH:C:\Users\mcbai\AppData\Local\Programs\Python\Python39 /LIBPATH:C:\Users\mcbai\AppData\Local\Programs\Python\Python39\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\um\x64" /EXPORT:PyInit_dicttoolz build\temp.win-amd64-3.9\Release\cytoolz/dicttoolz.obj /OUT:build\lib.win-amd64-3.9\cytoolz\dicttoolz.cp39-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.9\Release\cytoolz\dicttoolz.cp39-win_amd64.lib   
    dicttoolz.obj : warning LNK4197: export 'PyInit_dicttoolz' specified multiple times; using first specification
       Creating library build\temp.win-amd64-3.9\Release\cytoolz\dicttoolz.cp39-win_amd64.lib and object build\temp.win-amd64-3.9\Release\cytoolz\dicttoolz.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:\users\mcbai\appdata\local\programs\python\python39\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\mcbai\AppData\Local\Temp\pip-record-tgqd_7wt\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mcbai\AppData\Local\Programs\Python\Python39\Include\cytoolz' Check the logs for full command output.

Solution

  • 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