简体   繁体   中英

I have been trying to install web3 using pip but facing the following error:

Building wheel for lru-dict (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\WINDOWS 10\\AppData\\Local\\Temp\\pip-install-c5grxj8l\\lru-dict_eedc47faae9c4988bae8bb2b23e4074c\\setup.py'"'"'; __file__='"'"'C:\\Users\\WINDOWS 10\\AppData\\Local\\Temp\\pip-install-c5grxj8l\\lru-dict_eedc47faae9c4988bae8bb2b23e4074c\\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'"'"'))' bdist_wheel -d 'C:\Users\WINDOWS 10\AppData\Local\Temp\pip-wheel-bp7uaxvk'
       cwd: C:\Users\WINDOWS 10\AppData\Local\Temp\pip-install-c5grxj8l\lru-dict_eedc47faae9c4988bae8bb2b23e4074c\
  Complete output (13 lines):
  running bdist_wheel
  running build
  running build_ext
  creating build
  creating build\temp.win-amd64-3.8
  creating build\temp.win-amd64-3.8\Release
  "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ic:\anaconda3\include -Ic:\anaconda3\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tclru.c /Fobuild\temp.win-amd64-3.8\Release\lru.obj
  lru.c
  lru.c(629): warning C4113: 'PyCFunctionWithKeywords' differs in parameter lists from 'PyCFunction'
  creating C:\Users\WINDOWS 10\AppData\Local\Temp\pip-install-c5grxj8l\lru-dict_eedc47faae9c4988bae8bb2b23e4074c\build\lib.win-amd64-3.8
  "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\anaconda3\libs /LIBPATH:c:\anaconda3 /LIBPATH:c:\anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" /EXPORT:PyInit_lru build\temp.win-amd64-3.8\Release\lru.obj /OUT:build\lib.win-amd64-3.8\lru.cp38-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.8\Release\lru.cp38-win_amd64.lib
  LINK : fatal error LNK1181: cannot open input file 'C:\Users\WINDOWS.obj'
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed with exit code 1181
  ----------------------------------------
  ERROR: Failed building wheel for lru-dict

Initially, the error said to install Visual C++ Build Tools > 14.0. I did install that. But now the error is above. I tried a few of the solutions mentioned in other forums but nothing worked.

This is old and it doesn't show if the issue was resolved. However, experiencing a similar issue I bumped into your question. This was resolved by following the instructions on installing VC Build Tools using the following command...

vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools

found at exerror.com

https://exerror.com/error-legacy-install-failure/#:~:text=To%20Solve%20error%3A%20legacy%2Dinstall%2Dfailure%20Then%2C%20Upgrade,gensim%20OR%20pip3%20install%20gensim.

you could try $ pip install web3 . Link: https://web3py.readthedocs.io/en/stable/quickstart.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM