Collecting web3
Building wheels for collected packages: bitarray, lru-dict
Building wheel for bitarray (setup.py): started
Building wheel for bitarray (setup.py): finished with status 'error'
Running setup.py clean for bitarray
Building wheel for lru-dict (setup.py): started
Building wheel for lru-dict (setup.py): finished with status 'error'
Running setup.py clean for lru-dict
Failed to build bitarray lru-dict
Installing collected packages: bitarray, lru-dict, eth-account, web3
Attempting uninstall: bitarray
Found existing installation: bitarray 1.7.1
Uninstalling bitarray-1.7.1:
Successfully uninstalled bitarray-1.7.1
Running setup.py install for bitarray: started
Running setup.py install for bitarray: finished with status 'error'
Rolling back uninstall of bitarray
ERROR: Command errored out with exit status 1:
command: 'D:\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-x4q38lj3\\bitarray_13323f72a3ea4f0f9cf4960d95dfd778\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-x4q38lj3\\bitarray_13323f72a3ea4f0f9cf4960d95dfd778\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Administrator\AppData\Local\Temp\pip-wheel-nkwq_9g5'
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-x4q38lj3\bitarray_13323f72a3ea4f0f9cf4960d95dfd778\
Complete output (15 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\bitarray
copying bitarray\test_bitarray.py -> build\lib.win-amd64-3.8\bitarray
copying bitarray\test_util.py -> build\lib.win-amd64-3.8\bitarray
copying bitarray\util.py -> build\lib.win-amd64-3.8\bitarray
copying bitarray\__init__.py -> build\lib.win-amd64-3.8\bitarray
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'bitarray._bitarray' 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: Failed building wheel for bitarray
ERROR: Command errored out with exit status 1:
command: 'D:\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-x4q38lj3\\lru-dict_5656a7b5d4374bfb98a1bfd33e3c5c94\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-x4q38lj3\\lru-dict_5656a7b5d4374bfb98a1bfd33e3c5c94\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Administrator\AppData\Local\Temp\pip-wheel-z30my9oz'
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-x4q38lj3\lru-dict_5656a7b5d4374bfb98a1bfd33e3c5c94\
Complete output (5 lines):
running bdist_wheel
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: Failed building wheel for lru-dict
ERROR: Command errored out with exit status 1:
command: 'D:\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-x4q38lj3\\bitarray_13323f72a3ea4f0f9cf4960d95dfd778\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-x4q38lj3\\bitarray_13323f72a3ea4f0f9cf4960d95dfd778\\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\Administrator\AppData\Local\Temp\pip-record-2ejcfvyj\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Python\Python38\Include\bitarray'
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-x4q38lj3\bitarray_13323f72a3ea4f0f9cf4960d95dfd778\
Complete output (15 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\bitarray
copying bitarray\test_bitarray.py -> build\lib.win-amd64-3.8\bitarray
copying bitarray\test_util.py -> build\lib.win-amd64-3.8\bitarray
copying bitarray\util.py -> build\lib.win-amd64-3.8\bitarray
copying bitarray\__init__.py -> build\lib.win-amd64-3.8\bitarray
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'bitarray._bitarray' 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: 'D:\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-x4q38lj3\\bitarray_13323f72a3ea4f0f9cf4960d95dfd778\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-x4q38lj3\\bitarray_13323f72a3ea4f0f9cf4960d95dfd778\\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\Administrator\AppData\Local\Temp\pip-record-2ejcfvyj\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Python\Python38\Include\bitarray' Check the logs for full command output.
以上是有省略的,太长了,,,大概的意思就是缺少包,我这里显示是少了bitarray, lru-dict,cytoolz 三个,少了就直接pip install呗,但是!!安装不了啊,在网上看了很多解决方法,大部分都是说直接去找缺少的whl,然后导进去
https://www.lfd.uci.edu/~gohlke/pythonlibs/
https://pypi.org/
一般的包这两个网页里都可以找到,找到对应whl版本下载到本地一个文件夹,然后cmd进到文件夹再用pip install就可以安装成功了。
如果需要的包没有 whl 的,只有 .tar.gz 的,就下载解压后进入解压后的文件夹,用 python install setup.py 安装。
我的 lru-dict,cytoolz 两个包就是这样安装成功的,但是!!!bitarray安装成功后还是一直报错,并且好像还是又给我自动卸载了!!!!
没办法了呀,怎样卸载安装都不成功,并且一直都有一个错误想忽略都不得
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/
只能安装了呗,没办法呀,一直卡在安装这,,
点击 Microsoft Visual C++ Build Tools下载,提取码:5k3t。
双击Microsoft Visual C++ Build Tools.exe,选择默认即可,点击安装,等待是漫长的,去做点别的吧
看到这样子别怕,hhh 可以安装了
pip install web3 -i https://pypi.tuna.tsinghua.edu.cn/simple
参考博客:
以太坊智能合约项目开发——Web3.py库安装及错误解决方案
error: Microsoft Visual C++ 14.0 is required问题最佳解决方法
Python 典藏篇-Microsoft Visual C++ 14.0 is required,官方vc++运行库工具一键式解决!