简体   繁体   中英

Restarting Kernel after installing a module from Jupyter

I'm installing beautifulsoup4 with

pip install beautifulsoup4

After which I get the message

"Requirement already satisfied: beautifulsoup4 in /Users/usr/opt/anaconda3/lib/python3.8/site-packages (4.9.3)
Requirement already satisfied: soupsieve>1.2; python_version >= "3.0" in /Users/usr/opt/anaconda3/lib/python3.8/site-packages (from beautifulsoup4) (2.0.1)

Note: you may need to restart the kernel to use updated packages."

When I type

import beautifulsoup4

I get the following error

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-3-e646caa245dd> in <module>
----> 1 import beautifulsoup4

ModuleNotFoundError: No module named 'beautifulsoup4'

Apparently, I need to restart the Kernel but I don't know what this means as I'm a new Jupyter and Python user. Any help is much appreciated.

I was able to solve this issue by setting up the kernel after installing a new package.

conda activate your_env
conda install package
python -m ipykernel install --user --name=your_env

Reference: https://ipython.readthedocs.io/en/stable/install/kernel_install.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM