0

版本: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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (5.13.0)
Requirement already satisfied: eth-typing<3.0.0,>=2.0.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (2.2.2)
Requirement already satisfied: hexbytes<1.0.0,>=0.1.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages 
(from web3[tester]) (0.2.1)
Requirement already satisfied: ipfshttpclient==0.7.0a1 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (0.7.0a1)
Requirement already satisfied: protobuf<4,>=3.10.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (3.14.0)
Requirement already satisfied: eth-abi<3.0.0,>=2.0.0b6 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (2.1.1)
Requirement already satisfied: eth-account<0.6.0,>=0.5.3 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (0.5.4)
Requirement already satisfied: lru-dict<2.0.0,>=1.1.6 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages 
(from web3[tester]) (1.1.6)
Requirement already satisfied: eth-hash[pycryptodome]<1.0.0,>=0.2.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (0.2.0)
Requirement already satisfied: requests<3.0.0,>=2.16.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (2.25.0)
Requirement already satisfied: websockets<9.0.0,>=8.1.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (8.1)
Requirement already satisfied: jsonschema<4.0.0,>=3.2.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (3.2.0)
Requirement already satisfied: pypiwin32>=223; platform_system == "Windows" in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (223)
Requirement already satisfied: eth-utils<2.0.0,>=1.9.5 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from web3[tester]) (1.9.5)
Requirement already satisfied: py-geth<3,>=2.4.0; extra == "tester" in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from 
ipfshttpclient==0.7.0a1->web3[tester]) (0.0.9)
Requirement already satisfied: six>=1.9 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from protobuf<4,>=3.10.0->web3[tester]) (1.15.0)
Requirement already satisfied: parsimonious<0.9.0,>=0.8.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from requests<3.0.0,>=2.16.0->web3[tester]) (2020.11.8)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from requests<3.0.0,>=2.16.0->web3[tester]) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from requests<3.0.0,>=2.16.0->web3[tester]) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from requests<3.0.0,>=2.16.0->web3[tester]) (1.26.2)
Requirement already satisfied: attrs>=17.4.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from jsonschema<4.0.0,>=3.2.0->web3[tester]) (20.3.0)
Requirement already satisfied: setuptools in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from jsonschema<4.0.0,>=3.2.0->web3[tester]) (49.2.1)
Requirement already satisfied: pyrsistent>=0.14.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from jsonschema<4.0.0,>=3.2.0->web3[tester]) (0.17.3)
Requirement already satisfied: pywin32>=223 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.7.0a1->web3[tester]) (2.0.1)
Requirement already satisfied: varint in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.7.0a1->web3[tester]) (1.0.2)
Requirement already satisfied: netaddr in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.7.0a1->web3[tester]) (0.8.0)
Requirement already satisfied: toolz>=0.8.0 in c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\lib\site-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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\scripts\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ASUS\AppData\Local\Temp\pip-record-3sfswv97\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\include\site\python3.9\pyethash'
         cwd: C:\Users\ASUS\AppData\Local\Temp\pip-install-iver41qv\pyethash\
    Complete output (25 lines):
    running install
    running build
    running build_ext
    building 'pyethash' extension
    creating build
    creating build\temp.win-amd64-3.9
    creating build\temp.win-amd64-3.9\Release
    creating build\temp.win-amd64-3.9\Release\src
    creating build\temp.win-amd64-3.9\Release\src\libethash
    creating build\temp.win-amd64-3.9\Release\src\python
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL 
/DNDEBUG /MD -Ic:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\include -IC:\Users\ASUS\AppData\Local\Programs\Python\Python39\include -IC:\Users\ASUS\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/internal.c /Fobuild\temp.win-amd64-3.9\Release\src/libethash/internal.obj -Isrc/ -std=gnu99 -Wall
    cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
    internal.c
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): warning C4710: 'int sprintf_s(char *const ,const size_t,const char *const ,...)': function not inlined
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): note: see declaration of 'sprintf_s'
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL 
/DNDEBUG /MD -Ic:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\include -IC:\Users\ASUS\AppData\Local\Programs\Python\Python39\include -IC:\Users\ASUS\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/io.c /Fobuild\temp.win-amd64-3.9\Release\src/libethash/io.obj -Isrc/ -std=gnu99 -Wall
    cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
    io.c
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): warning C4710: 'int sprintf_s(char *const ,const size_t,const char *const ,...)': function not inlined
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdio.h(1833): note: see declaration of 'sprintf_s'
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL 
/DNDEBUG /MD -Ic:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\include -IC:\Users\ASUS\AppData\Local\Programs\Python\Python39\include -IC:\Users\ASUS\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/libethash/io_win32.c /Fobuild\temp.win-amd64-3.9\Release\src/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:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\scripts\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ASUS\AppData\Local\Temp\pip-record-3sfswv97\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\asus\desktop\ayush\programs\ethereum\starting_out\venv\include\site\python3.9\pyethash' Check the logs for full command output.

也许,错误在于线路 -cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'但不确定。

感谢所有帮助我找出并纠正问题的人。

4

1 回答 1

0

有两件事要尝试:

  • 运行时使用--no-cache-dir开关pip
  • cmake作为要求添加到您的库/应用程序

如果这不起作用,请前往web3.py gitter

于 2020-12-14T02:28:05.160 回答