No module named 'gensim' but already installed it

前端 未结 1 1088
野性不改
野性不改 2021-01-26 13:01

i\'m having this error problem, i have ran this script in jupyter notebook in base (root) environment, the log said that gensim library has been installed and i have run the com

相关标签:
1条回答
  • 2021-01-26 13:23

    It may be that your jupyter lab maybe running the base kernel and not the kernel of the virtual environment.

    Check by doing the following:

    import sys
    sys.executable
    

    into my notebook and got the result

    '/anaconda3/bin/python'
    

    If you get the above instead of the below then that means you're using the wrong kernel.

    '/anaconda3/envs/myenv/bin/python'
    

    You can solve it by creating a new iPython kernel for your new environment. Read more here.

    conda install -n myenv ipython
    conda activate myenv
    python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
    ```Then, to run Jupyter Lab in the new environment:
    
    0 讨论(0)
提交回复
热议问题