我一直在尝试通过 pipx 在 VSCode 的 Powershell 终端中安装 Brownie(https://eth-brownie.readthedocs.io/en/stable/install.html)。在链接中,我尝试了前两个命令,之后系统确认 pipx 已添加到 PATH:
python -m pip install --user pipx
python -m pipx ensurepath
...
C:\Users\Name\AppData\Roaming\Python\Python310\Scripts has been been added to PATH, but you need to open a new terminal or re-login for this PATH change to
take effect.
C:\Users\Name\.local\bin has been been added to PATH, but you need to open a new terminal or re-login for this PATH change to take effect.
You will need to open a new terminal or re-login for the PATH changes to take effect.
Otherwise pipx is ready to go! ✨ ✨
加载新的 Powershell 后,我尝试了链接中的最终命令,但在下面立即收到错误:
pipx install eth-brownie
...
pipx : The term 'pipx' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ pipx install eth-brownie
+ ~~~~
+ CategoryInfo : ObjectNotFound: (pipx:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如果输出声称它可以在 PATH 上访问,为什么 pipx 不被识别为命令?无论如何,然后我尝试修改命令以在开始时包含 python -m 。我的理解是这首先进入我的python程序,然后访问与pipx有关的任何内容?它运行了几秒钟,然后打印了一个不同的错误:
python -m pipx install eth-brownie
...
Fatal error from pip prevented installation. Full pip output in file:
C:\Users\Name\.local\pipx\logs\cmd_2022-01-05_20.58.07_pip_errors.log
pip failed to build package:
cytoolz
Some possibly relevant errors from pip install:
build\lib.win-amd64-3.10\cytoolz\functoolz.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
Error installing eth-brownie.
我对这个错误不知所措。我的直觉告诉我,我从以下网址下载的 Microsoft Build Tools 有问题:https ://visualstudio.microsoft.com/visual-cpp-build-tools/Code 。但如果我能解决第一个问题,也许这是多余的。