"ImportError: No module named 'jwt'" in Jupyter

Feyzi Bagirov picture Feyzi Bagirov · Feb 28, 2017 · Viewed 13.3k times · Source

I am trying to import jwt (JSON Web Token) into Python.

Following this I have installed the package. The package also seem to import in the terminal python environment.

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

However, when I am trying to import jwt inside Jupyter, I get this error:

ImportError: No module named 'jwt'

How do I get the module to import in Jupyter?

Answer

Feyzi Bagirov picture Feyzi Bagirov · Feb 28, 2017

It seems that I used a different Kernel.

After I switched Jupyter to 'Python[conda root]', package imported.