gpt4 book ai didi

google-colaboratory - 将 Web3 导入 Google Colab 时出错

转载 作者:行者123 更新时间:2023-12-03 08:31:23 29 4
gpt4 key购买 nike

我正在尝试在 Google Colab 中安装 web3,第一步是

!pip install web3

这似乎是一个小错误,成功结束了

ERROR: nbclient 0.5.1 has requirement jupyter-client>=6.1.5, but you'll have jupyter-client 5.3.5 which is incompatible.
Installing collected packages: pycryptodome, ... jsonschema,..... eth-account, web3
Found existing installation: jsonschema 2.6.0
Uninstalling jsonschema-2.6.0:
Successfully uninstalled jsonschema-2.6.0
Successfully installed base58-2.0.1 ... jsonschema-3.2.0 .... web3-5.13.0 websockets-8.1

请注意,已安装 jsonschema-3.2.0。
现在我执行

from web3 import Web3 

并出现以下错误

/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py in resolve(self, requirements, env, installer, replace_conflicting, extras)
773 # Oops, the "best" so far conflicts with a dependency
774 dependent_req = required_by[req]
--> 775 raise VersionConflict(dist, req).with_context(dependent_req)
776
777 # push the new requirements onto the stack

ContextualVersionConflict: (jsonschema 2.6.0 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('jsonschema<4.0.0,>=3.2.0'), {'web3'})

我无法理解的是,即使安装了 jsonschema-3.2.0,该错误仍然表明我们仍然坚持使用 jsonschema 2.6.0,即使它已被卸载。请帮忙

最佳答案

哦,好吧,我只需要重新安装 jsonschema!

!pip install --force-reinstall jsonschema==3.2.0

解决了当前的问题

关于google-colaboratory - 将 Web3 导入 Google Colab 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64981354/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com