#python #cl #web3py
#python #cl #web3py
Вопрос:
Версия: web3 == 5.13.0 Python: 3.9.0 ОС: win 10
pip freeze
вывод —
attrs==20.3.0
backcall==0.2.0
base58==2.0.1
bitarray==1.2.2
blake2b-py==0.1.3
cached-property==1.5.2
certifi==2020.11.8
chardet==3.0.4
colorama==0.4.4
cytoolz==0.11.0
decorator==4.4.2
eth-abi==2.1.1
eth-account==0.5.4
eth-hash==0.2.0
eth-keyfile==0.5.1
eth-keys==0.3.3
eth-rlp==0.2.1
eth-typing==2.2.2
eth-utils==1.9.5
hexbytes==0.2.1
idna==2.10
ipfshttpclient==0.7.0a1
ipython==7.19.0
ipython-genutils==0.2.0
jedi==0.17.2
jsonschema==3.2.0
lru-dict==1.1.6
multiaddr==0.0.9
mypy-extensions==0.4.3
netaddr==0.8.0
parsimonious==0.8.1
parso==0.7.1
pickleshare==0.7.5
prompt-toolkit==3.0.8
protobuf==3.14.0
py-ecc==4.1.0
py-geth==2.4.0
pycryptodome==3.9.9
Pygments==2.7.2
pypiwin32==223
pyrsistent==0.17.3
pywin32==300
requests==2.25.0
rlp==2.0.1
semantic-version==2.8.5
six==1.15.0
sortedcontainers==2.3.0
toolz==0.11.1
traitlets==5.0.5
trie==2.0.0a5
typing-extensions==3.7.4.3
urllib3==1.26.2
varint==1.0.2
wcwidth==0.2.5
web3==5.13.0
websockets==8.1
Код, вызвавший ошибку — pip install 'web3[tester]'
Полный вывод ошибки —
$ pip install 'web3[tester]'
Requirement already satisfied: web3[tester] in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (5.13.0)
Requirement already satisfied: eth-typing<3.0.0,>=2.0.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (2.2.2)
Requirement already satisfied: hexbytes<1.0.0,>=0.1.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages
(from web3[tester]) (0.2.1)
Requirement already satisfied: ipfshttpclient==0.7.0a1 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (0.7.0a1)
Requirement already satisfied: protobuf<4,>=3.10.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (3.14.0)
Requirement already satisfied: eth-abi<3.0.0,>=2.0.0b6 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (2.1.1)
Requirement already satisfied: eth-account<0.6.0,>=0.5.3 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (0.5.4)
Requirement already satisfied: lru-dict<2.0.0,>=1.1.6 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages
(from web3[tester]) (1.1.6)
Requirement already satisfied: eth-hash[pycryptodome]<1.0.0,>=0.2.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (0.2.0)
Requirement already satisfied: requests<3.0.0,>=2.16.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (2.25.0)
Requirement already satisfied: websockets<9.0.0,>=8.1.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (8.1)
Requirement already satisfied: jsonschema<4.0.0,>=3.2.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (3.2.0)
Requirement already satisfied: pypiwin32>=223; platform_system == "Windows" in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (223)
Requirement already satisfied: eth-utils<2.0.0,>=1.9.5 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (1.9.5)
Requirement already satisfied: py-geth<3,>=2.4.0; extra == "tester" in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from web3[tester]) (2.4.0)
Collecting eth-tester[py-evm]==v0.5.0-beta.3; extra == "tester"
Using cached eth_tester-0.5.0b3-py3-none-any.whl (59 kB)
Requirement already satisfied: multiaddr>=0.0.7 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from
ipfshttpclient==0.7.0a1->web3[tester]) (0.0.9)
Requirement already satisfied: six>=1.9 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from protobuf<4,>=3.10.0->web3[tester]) (1.15.0)
Requirement already satisfied: parsimonious<0.9.0,>=0.8.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from eth-abi<3.0.0,>=2.0.0b6->web3[tester]) (0.8.1)
Requirement already satisfied: eth-keyfile<0.6.0,>=0.5.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from eth-account<0.6.0,>=0.5.3->web3[tester]) (0.5.1)
Requirement already satisfied: eth-rlp<2,>=0.1.2 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from eth-account<0.6.0,>=0.5.3->web3[tester]) (0.2.1)
Requirement already satisfied: eth-keys!=0.3.2,<0.4.0,>=0.2.1 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from eth-account<0.6.0,>=0.5.3->web3[tester]) (0.3.3)
Requirement already satisfied: rlp<3,>=1.0.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from eth-account<0.6.0,>=0.5.3->web3[tester]) (2.0.1)
Requirement already satisfied: bitarray<1.3.0,>=1.2.1 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages
(from eth-account<0.6.0,>=0.5.3->web3[tester]) (1.2.2)
Requirement already satisfied: pycryptodome<4,>=3.6.6; extra == "pycryptodome" in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from eth-hash[pycryptodome]<1.0.0,>=0.2.0->web3[tester]) (3.9.9)
Requirement already satisfied: certifi>=2017.4.17 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from requests<3.0.0,>=2.16.0->web3[tester]) (2020.11.8)
Requirement already satisfied: chardet<4,>=3.0.2 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from requests<3.0.0,>=2.16.0->web3[tester]) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from requests<3.0.0,>=2.16.0->web3[tester]) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from requests<3.0.0,>=2.16.0->web3[tester]) (1.26.2)
Requirement already satisfied: attrs>=17.4.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from jsonschema<4.0.0,>=3.2.0->web3[tester]) (20.3.0)
Requirement already satisfied: setuptools in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from jsonschema<4.0.0,>=3.2.0->web3[tester]) (49.2.1)
Requirement already satisfied: pyrsistent>=0.14.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from jsonschema<4.0.0,>=3.2.0->web3[tester]) (0.17.3)
Requirement already satisfied: pywin32>=223 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from pypiwin32>=223; platform_system == "Windows"->web3[tester]) (300)
Requirement already satisfied: cytoolz<1.0.0,>=0.10.1; implementation_name == "cpython" in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from eth-utils<2.0.0,>=1.9.5->web3[tester]) (0.11.0)
Requirement already satisfied: semantic-version>=2.6.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from py-geth<3,>=2.4.0; extra == "tester"->web3[tester]) (2.8.5)
Collecting py-evm==0.3.0a20; extra == "py-evm"
Using cached py_evm-0.3.0a20-py3-none-any.whl (242 kB)
Requirement already satisfied: base58 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from multiaddr>=0.0.7->ipfshttpclient==0.7.0a1->web3[tester]) (2.0.1)
Requirement already satisfied: varint in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from multiaddr>=0.0.7->ipfshttpclient==0.7.0a1->web3[tester]) (1.0.2)
Requirement already satisfied: netaddr in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from multiaddr>=0.0.7->ipfshttpclient==0.7.0a1->web3[tester]) (0.8.0)
Requirement already satisfied: toolz>=0.8.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from cytoolz<1.0.0,>=0.10.1; implementation_name == "cpython"->eth-utils<2.0.0,>=1.9.5->web3[tester]) (0.11.1)
Requirement already satisfied: mypy-extensions<1.0.0,>=0.4.1 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from py-evm==0.3.0a20; extra == "py-evm"->eth-tester[py-evm]==v0.5.0-beta.3; extra == "tester"->web3[tester]) (0.4.3)
Collecting pyethash<1.0.0,>=0.1.27
Using cached pyethash-0.1.27.tar.gz (38 kB)
Requirement already satisfied: trie==2.0.0-alpha.5 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from py-evm==0.3.0a20; extra == "py-evm"->eth-tester[py-evm]==v0.5.0-beta.3; extra == "tester"->web3[tester]) (2.0.0a5)
Requirement already satisfied: py-ecc<5.0.0,>=1.4.7 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from py-evm==0.3.0a20; extra == "py-evm"->eth-tester[py-evm]==v0.5.0-beta.3; extra == "tester"->web3[tester]) (4.1.0)
Collecting eth-bloom<2.0.0,>=1.0.3
Using cached eth_bloom-1.0.3-py3-none-any.whl (5.4 kB)
Requirement already satisfied: cached-property<2,>=1.5.1 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from py-evm==0.3.0a20; extra == "py-evm"->eth-tester[py-evm]==v0.5.0-beta.3; extra == "tester"->web3[tester]) (1.5.2)
Requirement already satisfied: blake2b-py<0.2,>=0.1.2 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages
(from py-evm==0.3.0a20; extra == "py-evm"->eth-tester[py-evm]==v0.5.0-beta.3; extra == "tester"->web3[tester]) (0.1.3)
Requirement already satisfied: sortedcontainers<3,>=2.1.0 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from trie==2.0.0-alpha.5->py-evm==0.3.0a20; extra == "py-evm"->eth-tester[py-evm]==v0.5.0-beta.3; extra == "tester"->web3[tester]) (2.3.0)
Requirement already satisfied: typing-extensions<4,>=3.7.4 in c:usersasusdesktopayushprogramsethereumstarting_outvenvlibsite-packages (from trie==2.0.0-alpha.5->py-evm==0.3.0a20; extra == "py-evm"->eth-tester[py-evm]==v0.5.0-beta.3; extra == "tester"->web3[tester]) (3.7.4.3)
Using legacy 'setup.py install' for pyethash, since package 'wheel' is not installed.
Installing collected packages: pyethash, eth-bloom, py-evm, eth-tester
Running setup.py install for pyethash ... error
ERROR: Command errored out with exit status 1:
command: 'c:usersasusdesktopayushprogramsethereumstarting_outvenvscriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\ASUS\AppData\Local\Temp\pip-install-iver41qv\pyethash\setup.py'"'"'; __file__='"'"'C:\Users\ASUS\AppData\Local\Temp\pip-install-iver41qv\pyethash\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersASUSAppDataLocalTemppip-record-3sfswv97install-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersasusdesktopayushprogramsethereumstarting_outvenvincludesitepython3.9pyethash'
cwd: C:UsersASUSAppDataLocalTemppip-install-iver41qvpyethash
Complete output (25 lines):
running install
running build
running build_ext
building 'pyethash' extension
creating build
creating buildtemp.win-amd64-3.9
creating buildtemp.win-amd64-3.9Release
creating buildtemp.win-amd64-3.9Releasesrc
creating buildtemp.win-amd64-3.9Releasesrclibethash
creating buildtemp.win-amd64-3.9Releasesrcpython
C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333binHostX86x64cl.exe /c /nologo /Ox /W3 /GL
/DNDEBUG /MD -Ic:usersasusdesktopayushprogramsethereumstarting_outvenvinclude -IC:UsersASUSAppDataLocalProgramsPythonPython39include -IC:UsersASUSAppDataLocalProgramsPythonPython39include -IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333include -IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0shared -IC:Program Files (x86)Windows Kits10include10.0.18362.0um -IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt /Tcsrc/libethash/internal.c /Fobuildtemp.win-amd64-3.9Releasesrc/libethash/internal.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
internal.c
C:Program Files (x86)Windows Kits10include10.0.18362.0ucrtstdio.h(1833): warning C4710: 'int sprintf_s(char *const ,const size_t,const char *const ,...)': function not inlined
C:Program Files (x86)Windows Kits10include10.0.18362.0ucrtstdio.h(1833): note: see declaration of 'sprintf_s'
C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333binHostX86x64cl.exe /c /nologo /Ox /W3 /GL
/DNDEBUG /MD -Ic:usersasusdesktopayushprogramsethereumstarting_outvenvinclude -IC:UsersASUSAppDataLocalProgramsPythonPython39include -IC:UsersASUSAppDataLocalProgramsPythonPython39include -IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333include -IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0shared -IC:Program Files (x86)Windows Kits10include10.0.18362.0um -IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt /Tcsrc/libethash/io.c /Fobuildtemp.win-amd64-3.9Releasesrc/libethash/io.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
io.c
C:Program Files (x86)Windows Kits10include10.0.18362.0ucrtstdio.h(1833): warning C4710: 'int sprintf_s(char *const ,const size_t,const char *const ,...)': function not inlined
C:Program Files (x86)Windows Kits10include10.0.18362.0ucrtstdio.h(1833): note: see declaration of 'sprintf_s'
C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333binHostX86x64cl.exe /c /nologo /Ox /W3 /GL
/DNDEBUG /MD -Ic:usersasusdesktopayushprogramsethereumstarting_outvenvinclude -IC:UsersASUSAppDataLocalProgramsPythonPython39include -IC:UsersASUSAppDataLocalProgramsPythonPython39include -IC:Program Files (x86)Microsoft Visual Studio2019BuildTools10include10.0.18362.0shared -IC:Program Files (x86)Windows Kits10include10.0.18362.0um -IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt /Tcsrc/libethash/io_win32.c /Fobuildtemp.win-amd64-3.9Releasesrc/libethash/io_win32.obj -Isrc/ -std=gnu99 -Wall
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
io_win32.c
c1: fatal error C1083: Cannot open source file: 'src/libethash/io_win32.c': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersasusdesktopayushprogramsethereumstarting_outvenvscriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\ASUS\AppData\Local\Temp\pip-install-iver41qv\pyethash\setup.py'"'"';
__file__='"'"'C:\Users\ASUS\AppData\Local\Temp\pip-install-iver41qv\pyethash\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersASUSAppDataLocalTemppip-record-3sfswv97install-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersasusdesktopayushprogramsethereumstarting_outvenvincludesitepython3.9pyethash' Check the logs for full command output.
Возможно, ошибка связана со строкой, cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
но не уверен.
Спасибо всем, кто помогает мне разобраться и исправить проблему.
Ответ №1:
Две вещи, которые нужно попробовать:
- Использование
--no-cache-dir
переключателя при запускеpip
- Добавление
cmake
в качестве требования к вашей библиотеке / приложению
Если это не сработает, перейдите к web3.py гиттер.
Комментарии:
1. ethash не был совместим с Windows, отсюда и проблема. исправление — github.com/ayushm2003/ethash Кроме того, перенесен на WSL, но спасибо за ваше время.