PIP无法构建程序包cytolz



我试图使用"pipx install eth brownie"安装eth browne,但我收到一个错误,说

pip failed to build package: cytoolz
Some possibly relevant errors from pip install:
buildlib.win-amd64-3.10cytoolzfunctoolz.cp310-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe' failed with exit code 1120

我看过日志文件,它显示它未能构建cytolz。它还提到";警告:Cython未安装。没有Cython的建筑&";。根据我的有限理解,Cytolz是Cython的一部分,所以我认为eth Bronie安装失败的原因是因为它无法构建Cytolz,因为它试图在没有Cython时构建它。问题是我已经安装了cython:

C:Usersalaiy>pip install cython
Requirement already satisfied: cython in c:python310libsite-packages (0.29.24)

从日志文件中提取(我可以粘贴整件事,但它很长(:

Building wheels for collected packages: bitarray, cytoolz, lru-dict, parsimonious, psutil, pygments-lexer-solidity, varint, websockets, wrapt
Building wheel for bitarray (setup.py): started
Building wheel for bitarray (setup.py): finished with status 'done'
Created wheel for bitarray: filename=bitarray-1.2.2-cp310-cp310-win_amd64.whl size=55783 sha256=d4ae97234d659ed9ff1f0c0201e82c7e321bd3f4e122f6c2caee225172e7bfb2
Stored in directory: c:usersalaiyappdatalocalpipcachewheels1d29a85364620332cc833df35535f54074cf1e51f94d07d2a660bd6d
Building wheel for cytoolz (setup.py): started
Building wheel for cytoolz (setup.py): finished with status 'error'
Running setup.py clean for cytoolz
Building wheel for lru-dict (setup.py): started
Building wheel for lru-dict (setup.py): finished with status 'done'
Created wheel for lru-dict: filename=lru_dict-1.1.7-cp310-cp310-win_amd64.whl size=12674 sha256=6a7e7b2068eb8481650e0a2ae64c94223b3d2c018f163c5a0e7c1d442077450a
Stored in directory: c:usersalaiyappdatalocalpipcachewheels47adcb156cb52954bbc1c31b4766ca3f0ed9eae9b218812bca89d7b
Building wheel for parsimonious (setup.py): started
Building wheel for parsimonious (setup.py): finished with status 'done'
Created wheel for parsimonious: filename=parsimonious-0.8.1-py3-none-any.whl size=42724 sha256=f9235a9614af0f5204d6bb35b8bd30b9456eae3021b5c2a9904345ad7d07a49d
Stored in directory: c:usersalaiyappdatalocalpipcachewheelsb112f17a2f39b30d6780ae9f2be9a52056595e0d97c1b4531d183085
Building wheel for psutil (setup.py): started
Building wheel for psutil (setup.py): finished with status 'done'
Created wheel for psutil: filename=psutil-5.8.0-cp310-cp310-win_amd64.whl size=246135 sha256=834ab1fd1dd0c18e574fc0fbf07922e605169ac68be70b8a64fb90c49ad4ae9b
Stored in directory: c:usersalaiyappdatalocalpipcachewheels12a36d615295409067d58a62a069d30d296d61d3ac132605e3a9555c
Building wheel for pygments-lexer-solidity (setup.py): started
Building wheel for pygments-lexer-solidity (setup.py): finished with status 'done'
Created wheel for pygments-lexer-solidity: filename=pygments_lexer_solidity-0.7.0-py3-none-any.whl size=7321 sha256=46355292f790d07d941a745cd58b64c5592e4c24357f7cc80fe200c39ab88d32
Stored in directory: c:usersalaiyappdatalocalpipcachewheels36fdbc6ff4fe156d46016eca64c9652a1cd7af6411070c88acbeabf5
Building wheel for varint (setup.py): started
Building wheel for varint (setup.py): finished with status 'done'
Created wheel for varint: filename=varint-1.0.2-py3-none-any.whl size=1979 sha256=36b744b26ba7534a494757e16ab6e171d9bb60a4fe4663557d57034f1150b678
Stored in directory: c:usersalaiyappdatalocalpipcachewheels39485e33919c52a2a695a512ca394a5308dd12626a40bbcd288de814
Building wheel for websockets (setup.py): started
Building wheel for websockets (setup.py): finished with status 'done'
Created wheel for websockets: filename=websockets-9.1-cp310-cp310-win_amd64.whl size=91765 sha256=a00a9c801269ea2b86d72c0b0b654dc67672519721afeac8f912a157e52901c0
Stored in directory: c:usersalaiyappdatalocalpipcachewheels79f74e873eca27ecd6d7230caff265283a5a5112ad4cd1d945c022dd
Building wheel for wrapt (setup.py): started
Building wheel for wrapt (setup.py): finished with status 'done'
Created wheel for wrapt: filename=wrapt-1.12.1-cp310-cp310-win_amd64.whl size=33740 sha256=ccd729b6e3915164ac4994aef731f21cd232466b3f6c4823c9fda14b07e821c3
Stored in directory: c:usersalaiyappdatalocalpipcachewheels8e61d3d9e7053100177668fa43216a8082868c55015f8706abd974f2
Successfully built bitarray lru-dict parsimonious psutil pygments-lexer-solidity varint websockets wrapt
Failed to build cytoolz
Installing collected packages: toolz, eth-typing, eth-hash, cytoolz, six, pyparsing, eth-utils, varint, urllib3, toml, rlp, pyrsistent, pycryptodome, py, pluggy, parsimonious, packaging, netaddr, multidict, iniconfig, idna, hexbytes, eth-keys, colorama, charset-normalizer, certifi, base58, attrs, atomicwrites, yarl, typing-extensions, requests, python-dateutil, pytest, multiaddr, jsonschema, inflection, eth-rlp, eth-keyfile, eth-abi, chardet, bitarray, async-timeout, websockets, wcwidth, tomli, sortedcontainers, semantic-version, regex, pywin32, pytest-forked, pyjwt, pygments, protobuf, platformdirs, pathspec, mythx-models, mypy-extensions, lru-dict, ipfshttpclient, execnet, eth-account, dataclassy, click, asttokens, aiohttp, wrapt, web3, vyper, vvm, tqdm, pyyaml, pythx, python-dotenv, pytest-xdist, pygments-lexer-solidity, py-solc-x, py-solc-ast, psutil, prompt-toolkit, lazy-object-proxy, hypothesis, eth-event, eip712, black, eth-brownie
Running setup.py install for cytoolz: started
Running setup.py install for cytoolz: finished with status 'error'
PIP STDERR
----------
WARNING: The candidate selected for download or install is a yanked version: 'protobuf' candidate (version 3.18.0 at https://files.pythonhosted.org/packages/74/4e/9f3cb458266ef5cdeaa1e72a90b9eda100e3d1803cbd7ec02f0846da83c3/protobuf-3.18.0-py2.py3-none-any.whl#sha256=615099e52e9fbc9fde00177267a94ca820ecf4e80093e390753568b7d8cb3c1a (from https://pypi.org/simple/protobuf/))
Reason for being yanked: This version claims to support Python 2 but does not
ERROR: Command errored out with exit status 1:
command: 'C:Usersalaiy.localpipxvenvseth-brownieScriptspython.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\alaiy\AppData\Local\Temp\pip-install-d1bskwa2\cytoolz_f765f335272241adba2138f1920a35cd\setup.py'"'"'; __file__='"'"'C:\Users\alaiy\AppData\Local\Temp\pip-install-d1bskwa2\cytoolz_f765f335272241adba2138f1920a35cd\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersalaiyAppDataLocalTemppip-wheel-pxzumeav'
cwd: C:UsersalaiyAppDataLocalTemppip-install-d1bskwa2cytoolz_f765f335272241adba2138f1920a35cd
Complete output (70 lines):
ALERT: Cython not installed.  Building without Cython.
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.10
creating buildlib.win-amd64-3.10cytoolz
copying cytoolzcompatibility.py -> buildlib.win-amd64-3.10cytoolz
copying cytoolzutils_test.py -> buildlib.win-amd64-3.10cytoolz

设法在Win10 x64上使用python 3.10.1首先安装cython和cytolz:

python -m pip install --user cython
python -m pip install --user cytoolz
python -m pip install --user eth-brownie

https://github.com/eth-brownie/brownie/issues/1315

我遇到了同样的问题,并这样做了。。。

python -m pip install --user cython
python -m pip install --user cytoolz
python -m pip install --user eth-brownie
python -m pip install --user pipx
python -m pipx ensurepath
# RESTARTED TERMINAL
pipx install eth-brownie

当时我很乐意去,可以输入";布朗尼;在终端中,而不会出现错误。我正在阅读的一些文档中有python3,删除3似乎有效。

将OP的解决方案从问题迁移到答案

Cython在Python 3.10上似乎不受支持(参考https://github.com/eth-brownie/brownie/issues/1300和https://github.com/cython/cython/issues/4046)。我降级到Python 3.9.7,eth brownie安装成功了!(

我使用过:

pip install eth-brownie

它运行良好,我不需要降级。

我是新手,所以也许我错了,但它对我来说很好。

最新更新