【问题标题】:ContextualVersionConflict : Error while importing streamlit in Google ColabContextualVersionConflict:在 Google Colab 中导入流光时出错
【发布时间】:2021-08-25 06:24:30
【问题描述】:

即使在执行 reset runtime 之后,我也会收到此错误。这个过程对我不起作用。建议另一种方式。

ContextualVersionConflict                 Traceback (most recent call last)
<ipython-input-2-8f70969ba6d2> in <module>()
      2 import numpy as np
      3 import cv2
----> 4 import streamlit as st
      5 from tensorflow import keras
      6 from tensorflow.keras.models import load_model

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

ContextualVersionConflict: (ipykernel 4.10.1 (/usr/local/lib/python3.7/dist-packages), Requirement.parse('ipykernel>=5.1.2; python_version >= "3.4"'), {'pydeck'})

【问题讨论】:

    标签: python deep-learning google-colaboratory streamlit


    【解决方案1】:

    说明ipykernel版本与streamlit要求的版本不匹配。

    使用这个

    !pip install ipykernel>=5.1.2
    !pip install pydeck
    

    使用上述代码后,点击Runtime,然后点击Restart Runtime

    【讨论】:

    • 您是否安装了上述库并重新启动运行时?
    • 是的,我安装了库并重新启动运行时,但仍然出现相同的错误。
    • @AnnadataAlekhya 你能把colab的访问权限给pdahal2871@gmail.com吗?
    • 我把链接分享给你了。
    • @AnnadataAlekhya 不,我的 gmail 帐户中没有任何邀请
    猜你喜欢
    • 2021-04-26
    • 2022-06-16
    • 1970-01-01
    • 2023-03-03
    • 2021-08-18
    • 1970-01-01
    • 2019-01-28
    • 2020-09-20
    • 1970-01-01
    相关资源
    最近更新 更多