【问题标题】:"ImportError: No module named 'jwt'" in JupyterJupyter 中的“ImportError:没有名为‘jwt’的模块”
【发布时间】:2017-07-18 21:58:52
【问题描述】:

我正在尝试将 jwt(JSON Web 令牌)导入 Python。

按照this 我已经安装了这个包。该包似乎也可以在终端 python 环境中导入。

>pip install PyJWT
>pip freeze
>PyJWT==1.4.2
>which pip
//anaconda/bin/jupyter
>which jupyter
//anaconda/bin/jupyter
>which jwt
//anaconda/bin/jwt

但是,当我尝试在 Jupyter 中导入 jwt 时,出现以下错误:

ImportError: No module named 'jwt'

如何在 Jupyter 中导入模块?

【问题讨论】:

  • 你试过重启内核了吗?
  • 是的,得到相同的结果。

标签: python import jwt jupyter pyjwt


【解决方案1】:

看来我使用了不同的内核。

在我将 Jupyter 切换到“Python[conda root]”后,导入了包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-28
    • 2017-08-04
    • 2017-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-10
    • 1970-01-01
    相关资源
    最近更新 更多