Issue
I have a module installed in my Juyter notebook
!pip install gensim
Requirement already satisfied: gensim in /home/m.gawinecki/virtualenv/la-recoms/lib/python3.7/site-packages (3.8.2)
However, when I try to import it, it fails
import gensim
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-e70e92d32c6e> in <module>
----> 1 import gensim
ModuleNotFoundError: No module named 'gensim'
It looks like it has been installed properly:
!pip list | grep gensim
gensim 3.8.2
How can I fix it?
Solution
Add your virtual environment as Python kernel in this way (Make sure it's activated):
(venv)
$ ipython kernel install --name "local-venv-kernel" --user
Now, you can select the created kernel "local-venv-kernel" when you start Jupyter notebook or lab.
You could check the installed libraries using this code in a notebook cell:
!pip freeze
Answered By - negas
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.