pip install web3 - 错误:需要 Microsoft Visual C++ 14.0 或更高版本
Posted
技术标签:
【中文标题】pip install web3 - 错误:需要 Microsoft Visual C++ 14.0 或更高版本【英文标题】:pip install web3 - ERROR: Microsoft Visual C++ 14.0 or greater is required 【发布时间】:2021-12-04 08:18:56 【问题描述】:我收到一条错误消息,类似于网站上已有的一些问题。不幸的是,到目前为止,所描述的解决方案都没有对我有用...
pip 安装 web3
返回以下消息:
PS C:\Users\me\Documents> pip install web3
Collecting web3
Using cached web3-5.24.0-py3-none-any.whl (487 kB)
Requirement already satisfied: jsonschema<4.0.0,>=3.2.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (3.2.0)
Collecting lru-dict<2.0.0,>=1.1.6
Using cached lru-dict-1.1.7.tar.gz (10 kB)
Requirement already satisfied: eth-abi<3.0.0,>=2.0.0b6 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (2.1.1)
Requirement already satisfied: hexbytes<1.0.0,>=0.1.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (0.2.2)
Requirement already satisfied: eth-typing<3.0.0,>=2.0.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (2.2.2)
Requirement already satisfied: websockets<10,>=9.1 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (9.1)
Requirement already satisfied: eth-utils<2.0.0,>=1.9.5 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (1.10.0)
Requirement already satisfied: eth-hash[pycryptodome]<1.0.0,>=0.2.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (0.3.2)
Requirement already satisfied: requests<3.0.0,>=2.16.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (2.26.0)
Requirement already satisfied: pywin32>=223; platform_system == "Windows" in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (302)
Requirement already satisfied: ipfshttpclient==0.8.0a2 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (0.8.0a2)
Requirement already satisfied: aiohttp<4,>=3.7.4.post0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (3.7.4.post0)
Collecting eth-account<0.6.0,>=0.5.6
Using cached eth_account-0.5.6-py3-none-any.whl (101 kB)
Requirement already satisfied: protobuf<4,>=3.10.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from web3) (3.18.1)
Requirement already satisfied: pyrsistent>=0.14.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from jsonschema<4.0.0,>=3.2.0->web3) (0.18.0)
Requirement already satisfied: setuptools in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from jsonschema<4.0.0,>=3.2.0->web3) (58.2.0)
Requirement already satisfied: attrs>=17.4.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from jsonschema<4.0.0,>=3.2.0->web3) (21.2.0)
Requirement already satisfied: six>=1.11.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from jsonschema<4.0.0,>=3.2.0->web3) (1.16.0)
Requirement already satisfied: parsimonious<0.9.0,>=0.8.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from eth-abi<3.0.0,>=2.0.0b6->web3) (0.8.1)
Requirement already satisfied: cytoolz<1.0.0,>=0.10.1; implementation_name == "cpython" in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from eth-utils<2.0.0,>=1.9.5->web3) (0.11.0)
Requirement already satisfied: pycryptodome<4,>=3.6.6; extra == "pycryptodome" in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from eth-hash[pycryptodome]<1.0.0,>=0.2.0->web3) (3.11.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0.0,>=2.16.0->web3) (1.26.7)
Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0.0,>=2.16.0->web3) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0.0,>=2.16.0->web3) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0.0,>=2.16.0->web3) (3.3)
Requirement already satisfied: multiaddr>=0.0.7 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from ipfshttpclient==0.8.0a2->web3) (0.0.9)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4,>=3.7.4.post0->web3) (5.2.0)
Requirement already satisfied: async-timeout<4.0,>=3.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4,>=3.7.4.post0->web3) (3.0.1)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from
aiohttp<4,>=3.7.4.post0->web3) (1.7.0)
Requirement already satisfied: chardet<5.0,>=2.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4,>=3.7.4.post0->web3) (4.0.0)
Requirement already satisfied: typing-extensions>=3.6.5 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from aiohttp<4,>=3.7.4.post0->web3) (3.10.0.2)
Requirement already satisfied: eth-rlp<2,>=0.1.2 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from eth-account<0.6.0,>=0.5.6->web3) (0.2.1)
Collecting bitarray<1.3.0,>=1.2.1
Using cached bitarray-1.2.2.tar.gz (48 kB)
Requirement already satisfied: eth-keyfile<0.6.0,>=0.5.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from eth-account<0.6.0,>=0.5.6->web3) (0.5.1)
Requirement already satisfied: rlp<3,>=1.0.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from eth-account<0.6.0,>=0.5.6->web3) (2.0.1)
Requirement already satisfied: eth-keys!=0.3.2,<0.4.0,>=0.2.1 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from eth-account<0.6.0,>=0.5.6->web3) (0.3.3)
Requirement already satisfied: toolz>=0.8.0 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from cytoolz<1.0.0,>=0.10.1; implementation_name == "cpython"->eth-utils<2.0.0,>=1.9.5->web3) (0.11.1)
Requirement already satisfied: base58 in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (2.1.0)
Requirement already satisfied: netaddr in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (0.8.0)
Requirement already satisfied: varint in c:\users\me\appdata\local\programs\python\python39\lib\site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (1.0.2)
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.
Installing collected packages: lru-dict, bitarray, eth-account, web3
Running setup.py install for lru-dict ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\me\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-h8y06ka1\\lru-dict\\setup.py'"'"'; __file__='"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-h8y06ka1\\lru-dict\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\me\AppData\Local\Temp\pip-record-g2445zhn\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\me\appdata\local\programs\python\python39\Include\lru-dict'
cwd: C:\Users\me\AppData\Local\Temp\pip-install-h8y06ka1\lru-dict\
Complete output (5 lines):
running install
running build
running build_ext
building 'lru' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\me\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-h8y06ka1\\lru-dict\\setup.py'"'"'; __file__='"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-h8y06ka1\\lru-dict\\setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\me\AppData\Local\Temp\pip-record-g2445zhn\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\me\appdata\local\programs\python\python39\Include\lru-dict' Check the logs for full command output.
WARNING: You are using pip version 20.2; however, version 21.3 is available.
You should consider upgrading via the 'c:\users\me\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
不幸的是,如上所述,到目前为止,其他问题的可能解决方案对我没有帮助(本文末尾是我已经尝试过的简短列表)。有谁知道任何其他可能的解决方案?如果需要,我还可以发布更多消息。不幸的是,我对能够缩小范围的问题了解不多。
除了 Python 3.10.0,我还安装了 Python 3.9.6 和 3.9.5 我已将 pip 版本从 21.1.3 降级到 20.2 我已经更新了 setuptools 以下条目位于 PATH 变量中:C:\ProgramData\Miniconda3
C:\ProgramData\Miniconda3\Library\mingw-w64\bin
C:\ProgramData\Miniconda3\Library\usr\bin
C:\ProgramData\Miniconda3\Library\bin
C:\ProgramData\Miniconda3\Scripts
C:\Program Files\Common Files\Oracle\Java\javapath
C:\Program Files\Rockwell Software\RSCommon
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\
C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files\PuTTY\
C:\Program Files\dotnet\
C:\Users\janis\AppData\Local\Programs\Python\Python39\Scripts\
C:\Users\janis\AppData\Local\Programs\Python\Python39\
C:\Users\janis\AppData\Local\Microsoft\WindowsApps
C:\Users\janis\AppData\Roaming\TinyTeX\bin\win32
C:\Users\janis\AppData\Local\Programs\Python\Python310\
C:\Users\janis\AppData\Local\Programs\Python\Python310\Scripts\
C:\Windows\SysWow64\
C:\Users\janis\AppData\Local\Programs\Microsoft VS Code\bin
C:\Windows\System32
C:\Users\janis\AppData\Local\Programs\Python\Python39\Lib
C:\Users\janis\AppData\Local\Programs\Python\Python310\Lib
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn
C:\Users\janis\.dotnet\tools
我还安装了 Visual Studio Build Tools 2019(现在可能有太多单独的组件,但我好几天都没有到任何地方,我有点绝望......):
【问题讨论】:
【参考方案1】:我花了几个小时试图解决这个问题,我终于安装了 web3。转到 Visual Studio 安装程序。如果您已经安装了 Visual Studio 构建工具 2019,请单击修改,然后转到工作负载并使用 C++ 安装桌面开发。如果您没有 2019 年的视觉工作室构建工具,那么只需使用 c++ 桌面开发安装它。我希望这对你有用!
【讨论】:
以上是关于pip install web3 - 错误:需要 Microsoft Visual C++ 14.0 或更高版本的主要内容,如果未能解决你的问题,请参考以下文章
尝试 npm install web3 时出现致命错误 LNK1181
vscode 终端 执行pip install --upgrade pip 错误解决办法
pip安装Python包出现错误,easy_install可以安装
python+vlc 实现视频播放 ,需要安装这个vlc这个模块,使用pip install vlc安装,出现无法找到模块错误解决方法