05-08-2019 01:05 PM
Hi,
I would like to do some web scrapping, however I am unable to import the libraries I traditionally use for that task
import requests
from bs4 import BeautifulSoup
06-05-2019 09:10 AM
@one_employee
When you installed bs4 with easy_instal, you installed it system-wide. So your system python can import it, but not your virtualenv python. If you do not need bs4 to be installed in your system python path, uninstall it and keep it in your virtualenv.
I will advise you to uninstall the bs4 library by using this command:
pip uninstall bs4
and then install it using this command:
sudo apt-get install python3-bs4
08-13-2020 02:56 AM
You need a file named init.py (two underscores on each side) in every folder in the hierarchy. This is what python looks for to know that it should access a particular folder. The files are meant to contain initialization instructions but even if you create them empty this will solve it. To get rid of this error “ImportError: No module named”, you just need to create init.py in the appropriate directory and everything will work fine.
10-04-2021 09:09 PM
Did you try
`%pip install bs4 `
requests is standard in the databricks runtime, so you don't have to install it.
10-06-2021 04:14 AM
05-18-2022 01:38 PM
Hi @Ikram Mecheri , Just a friendly follow-up. Do you still need help, or do the above responses help you find the solution? Please let us know.