'Why am I getting an error when running "$ pip install web3" and how can I fix it?
When I run $ pip install web3, I get an error about lru-dict not installing, and I can't figure out why.
I have installed VS 2015, 2017, 2019, and 2022, including each different SDK option based on different questions/answers that proved to help others here, yet I am still getting the error. I have also removed Python from my system and re-installed, trying 3.9 and 3.10 both in separate venvs, before trying
$ pip3 install --upgrade web3
I did perform these also:
$ pip3 install --upgrade pip, install, py-solc-x, distlib, and setuptools.
I have also done
$ pip3 install --upgrade wheel
but that then creats another error including the same one I have currently so I reverted.
"PS C:\Users\Jacob\demos\web3_py_simple_storage> Set-ExecutionPolicy Unrestricted -Scope Process
PS C:\Users\Jacob\demos\web3_py_simple_storage> .\.env310\Scripts\activate
(.env310) PS C:\Users\Jacob\demos\web3_py_simple_storage> pip3 install --upgrade pip install setuptools py-solc-x
Requirement already satisfied: pip in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (22.0.4)
Requirement already satisfied: install in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (1.3.5)
Requirement already satisfied: setuptools in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (62.1.0)
Requirement already satisfied: py-solc-x in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (1.1.1)
Requirement already satisfied: requests<3,>=2.19.0 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from py-solc-x) (2.27.1)
Requirement already satisfied: semantic-version<3,>=2.8.1 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from py-solc-x) (2.9.0)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from requests<3,>=2.19.0->py-solc-x) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from requests<3,>=2.19.0->py-solc-x) (1.26.9)
Requirement already satisfied: idna<4,>=2.5 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from requests<3,>=2.19.0->py-solc-x) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from requests<3,>=2.19.0->py-solc-x) (2021.10.8)
(.env310) PS C:\Users\Jacob\demos\web3_py_simple_storage> pip3 install --upgrade web3
Collecting web3
Using cached web3-5.29.0-py3-none-any.whl (500 kB)
Collecting hexbytes<1.0.0,>=0.1.0
Using cached hexbytes-0.2.2-py3-none-any.whl (6.1 kB)
Collecting lru-dict<2.0.0,>=1.1.6
Using cached lru-dict-1.1.7.tar.gz (10 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: requests<3.0.0,>=2.16.0 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from web3) (2.27.1)
Collecting eth-account<0.6.0,>=0.5.7
Using cached eth_account-0.5.7-py3-none-any.whl (101 kB)
Collecting eth-hash[pycryptodome]<1.0.0,>=0.2.0
Using cached eth_hash-0.3.2-py3-none-any.whl (8.8 kB)
Collecting ipfshttpclient==0.8.0a2
Using cached ipfshttpclient-0.8.0a2-py3-none-any.whl (82 kB)
Requirement already satisfied: pywin32>=223 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from web3) (304)
Collecting eth-typing<3.0.0,>=2.0.0
Using cached eth_typing-2.3.0-py3-none-any.whl (6.2 kB)
Collecting eth-abi<3.0.0,>=2.0.0b6
Using cached eth_abi-2.1.1-py3-none-any.whl (27 kB)
Collecting eth-utils<2.0.0,>=1.9.5
Using cached eth_utils-1.10.0-py3-none-any.whl (24 kB)
Collecting aiohttp<4,>=3.7.4.post0
Using cached aiohttp-3.8.1-cp310-cp310-win_amd64.whl (555 kB)
Collecting protobuf<4,>=3.10.0
Using cached protobuf-3.20.1-cp310-cp310-win_amd64.whl (903 kB)
Collecting websockets<10,>=9.1
Using cached websockets-9.1-cp310-cp310-win_amd64.whl
Collecting jsonschema<5,>=3.2.0
Using cached jsonschema-4.4.0-py3-none-any.whl (72 kB)
Collecting multiaddr>=0.0.7
Using cached multiaddr-0.0.9-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from aiohttp<4,>=3.7.4.post0->web3) (2.0.12)
Collecting async-timeout<5.0,>=4.0.0a3
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting yarl<2.0,>=1.0
Using cached yarl-1.7.2-cp310-cp310-win_amd64.whl (122 kB)
Collecting attrs>=17.3.0
Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting frozenlist>=1.1.1
Using cached frozenlist-1.3.0-cp310-cp310-win_amd64.whl (33 kB)
Collecting aiosignal>=1.1.2
Using cached aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
Collecting multidict<7.0,>=4.5
Using cached multidict-6.0.2-cp310-cp310-win_amd64.whl (27 kB)
Collecting parsimonious<0.9.0,>=0.8.0
Using cached parsimonious-0.8.1-py3-none-any.whl
Collecting eth-keys<0.4.0,>=0.3.4
Using cached eth_keys-0.3.4-py3-none-any.whl (21 kB)
Collecting rlp<3,>=1.0.0
Using cached rlp-2.0.1-py2.py3-none-any.whl (20 kB)
Collecting bitarray<1.3.0,>=1.2.1
Using cached bitarray-1.2.2.tar.gz (48 kB)
Preparing metadata (setup.py) ... done
Collecting eth-rlp<2,>=0.1.2
Using cached eth_rlp-0.3.0-py3-none-any.whl (5.0 kB)
Collecting eth-keyfile<0.6.0,>=0.5.0
Using cached eth_keyfile-0.5.1-py3-none-any.whl (8.3 kB)
Collecting pycryptodome<4,>=3.6.6
Using cached pycryptodome-3.14.1-cp35-abi3-win_amd64.whl (1.8 MB)
Collecting cytoolz<1.0.0,>=0.10.1
Using cached cytoolz-0.11.2.tar.gz (481 kB)
Preparing metadata (setup.py) ... done
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
Using cached pyrsistent-0.18.1-cp310-cp310-win_amd64.whl (61 kB)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from requests<3.0.0,>=2.16.0->web3) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from requests<3.0.0,>=2.16.0->web3) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from requests<3.0.0,>=2.16.0->web3) (1.26.9)
Collecting toolz>=0.8.0
Using cached toolz-0.11.2-py3-none-any.whl (55 kB)
Collecting eth-rlp<2,>=0.1.2
Using cached eth_rlp-0.2.1-py3-none-any.whl (5.0 kB)
Requirement already satisfied: varint in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (1.0.2)
Requirement already satisfied: netaddr in c:\users\jacob\demos\web3_py_simple_storage\.env310\lib\site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (0.8.0)
Collecting base58
Using cached base58-2.1.1-py3-none-any.whl (5.6 kB)
Collecting six
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using legacy 'setup.py install' for lru-dict, since package 'wheel' is not installed.
Using legacy 'setup.py install' for bitarray, since package 'wheel' is not installed.
Using legacy 'setup.py install' for cytoolz, since package 'wheel' is not installed.
Installing collected packages: lru-dict, bitarray, websockets, toolz, six, pyrsistent, pycryptodome, protobuf, multidict, hexbytes, frozenlist, eth-typing, eth-hash, base58, attrs, async-timeout, yarl, parsimonious, multiaddr, jsonschema, cytoolz, aiosignal, ipfshttpclient, eth-utils, aiohttp, rlp, eth-keys, eth-abi, eth-rlp, eth-keyfile, eth-account, web3
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
╰─> [13 lines of output]
running install
C:\Users\Jacob\demos\web3_py_simple_storage\.env310\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
creating build
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Jacob\demos\web3_py_simple_storage\.env310\include -IC:\Users\Jacob\pyver\python3.10.4\include -IC:\Users\Jacob\pyver\python3.10.4\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\include" /Tclru.c /Fobuild\temp.win-amd64-cpython-310\Release\lru.obj
lru.c
C:\Users\Jacob\pyver\python3.10.4\include\pyconfig.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\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.31.31103\\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."
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
