0

I am unable to perform the pip install web3. its giving me this error

Running setup.py install for lru-dict ... error error: subprocess-exited-with-error

× Running setup.py install for lru-dict did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
running install
C:\Users\Rishi Garg personal\AppData\Local\Programs\Python\Python310\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_ext
building 'lru' extension
lru.c
C:\Users\Rishi Garg personal\AppData\Local\Programs\Python\Python310\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file
error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> lru-dict

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

PS C:\Users\Rishi Garg personal\demos\web3_py_simple_storage> python deploy.py
INFO: Could not find files for the given pattern(s).
Traceback (most recent call last):
File "C:\Users\Rishi Garg personal\demos\web3_py_simple_storage\deploy.py", line 7, in
from web3 import Web3
ModuleNotFoundError: No module named 'web3'
Siva Sankaran
  • 1,398
  • 3
  • 18
  • 38
rishi
  • 1
  • 2
    `web3` needs to install `lru-dict`, which has to compile some C code. You do not seem to have a C compiler installed. – Tim Roberts Feb 14 '22 at 23:32
  • how do i add a c compiler? – rishi Feb 15 '22 at 15:08
  • Actually, it appears you DO have the Visual Studio 2022 Community Edition installed. Based on the message in the duplicate link above, you may just need to install the Windows 10 SDK. I'd probably go with version 10.0.18362. https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/ – Tim Roberts Feb 15 '22 at 19:21

0 Answers0