Unable to import an installed package - python

I use the Enthought Canopy environment with Python, v1.5.5. The Package Manager indicates I have beautifulsoup4 installed, v4.3.2-5. Yet all of the following fail, producing Import Error: No module named xxxxxx:
import beautifulsoup
import beautifulsoup4
import BeautifulSoup
Listing installed packages with pip includes ..., 'beautifulsoup4==4.3.2', ... in the list.

According to what is there in the "Quick Start" documentation paragraph:
from bs4 import BeautifulSoup

Related

importing beautiful soup using python 3.6 on OS X

please help!
I am using a macbook running OS X 10.10.5
I am trying to install and then import beautifulsoup using python 3.6 but am getting the following error:
ModuleNotFoundError: No module named ‘beautiful soup’
This is what I have done:
installed python 3.6, this has installed in the applications folder, this is working fine with idle.
downloaded and installed beautifulsoup4, installed using: sudo python setup.py install. This has installed beautifulsoup4-4.5.3-py2.7.egg files into the Library/2.7/site-packages directory
My code is as follows:
import sys
sys.path.append("Macintosh HD/Library/Python/2.7/site-packages")
import beautifulsoup4
Any ideas? Many thanks in advance.
Have you ever checked the documentation of that package?
You import this package as below:
from bs4 import BeautifulSoup

Installation of beautifulsoup

I am using Python 2.7.13
I have used the command prompt to install beautifulsoup : easy_install beautifulsoup4
I got messages with a best match', 'downloading ..... etc and finally an error:None.
However when running a script which says
from BeautifulSoup import *
I got the error message
ImportError: No module named BeautifulSoup
does the error: None mean it has installed properly
what does it actually do when you install beautifulsoup, is it there forever? Do you need to install it each time you use Python? Where does it install it to i.e. where should I check to see if its actually there ?
from bs4 import BeautifulSoup also gives the same answer
You can install Beautiful Soup with PIP(python package index)
pip install beautifulsoup4

ImportError: No module named bs4?

I try to import library: from bs4 import BeautifulSoup.
When I run script I get error:
Traceback (most recent call last):
File "index.py", line 9, in <module>
from bs4 import BeautifulSoup
ImportError: No module named bs4
root#srvr [/home/public_html/grabber/similar]#
When I try install:
pip install beautifulsoup4
I get the following error:
Requirement already satisfied: beautifulsoup4 in /usr/lib/python2.6/site-packages/beautifulsoup4-4.5.1-py2.6.egg
Script is:
import sys
sys.path.append('/usr/lib/python2.6/site-packages')
from bs4 import BeautifulSoup
You installed BeautifulSoup for Python 2.6, but according to your tag, you are using Python 3.x. To install explicitly for Python 3, use pip3 instead of pip, i.e.
pip3 install beautifulsoup4
If you try this on Mac OS X do the following:
Go to the official website: http://www.crummy.com/software/BeautifulSoup/
Download the .tar.gz package
Unpack it
Go to the unpacked folder
Type: python setup.py install
If you use Pycharm, go to preferences - project interpreter - install bs4. If you try to install BeautifulSoup, it will still show that no module named bs4.

Unable to import beautifulsoup in python

I'm using Python.7.10 and have installed beautifulsoup using pip. The package was installed successfully. But when I'm trying to import beautifulsoup, I'm getting this error:
ImportError: No module named beautifulsoup
I checked the list of my installed modules and I found the beautifulsoup module in the installed modules list:
You installed BeautifulSoup version 3; the module is called BeautifulSoup with capital B and S:
from BeautifulSoup import BeautifulSoup
See the Quickstart documentation.
You really want to upgrade to BeautifulSoup 4. BeautifulSoup 3 was discontinued in 2012.
To install version 4, use:
pip install beautifulsoup4
and import bs4:
from bs4 import BeautifulSoup
Do study the project documentation before continuing however.

Beautiful Soup 4 Import

So I'm getting an import error on this line:
from bs4 import BeautifulSoup
It says:
ImportError: no module named 'bs4'
Any idea what's going on / how to fix this?
Thanks,
Mariogs
import sys; print(sys.path) shows that you use Python 3.3 but the output from pip shows that it installs for Python 2.7
Use pip that installs for Python 3.3. It might be already installed as pip3 or pip3.3. If not; then install it first.

Categories

Resources