Python Forum
Installation of bs4 and BeatifulSoup
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installation of bs4 and BeatifulSoup
#1
I am trying to use BeatifulSoup from bs4. I am using eclipse IDE.

I followed the installation guide. Install by $ pip install beautifulsoup4:

Requirement already satisfied: beautifulsoup4 in ./anaconda/lib/python3.5/site-packages

It seems it has already been there.

Then, I followed "https://www.youtube.com/watch?v=J5YVlMB1m98" to add bs4 folder from "/anaconda/lib/python3.5/site-packages" path to my PyDev project in ecplise.

But it still does not work showing "unresolved import bs4" besides "import bs4" statement.

Thanks for helps,

L

It seems the beautifulsoup4 library installed into the " lib/python3.5/site-packages" folder.
So if I chose python2.7 to interpret my project, does this cause the problem?

Thanks,

L
Reply
#2
change directory to python2.7 folder then to Scripts subfolder. If you run pip from there, it will be for python 2.7
Reply
#3
(Jan-09-2017, 02:51 AM)Larz60+ Wrote: change directory to python2.7 folder then to Scripts subfolder. If you run pip from there, it will be for python 2.7

Do you mean I should move it to "/anaconda/lib/python2.7/site-packages"?

I am also wondering Why it should be under "/anaconda/"?

L

(Jan-09-2017, 02:51 AM)Larz60+ Wrote: change directory to python2.7 folder then to Scripts subfolder. If you run pip from there, it will be for python 2.7

Now it errors even I am trying to import pandas.

I think I have pip install all these lib. But it seems the eclipse cannot find these lib.

If I play python under iPython, there is no such problems

L
Reply
#4
No No No ...
just change the directory (or use full path to pip)
Reply
#5
Do you know the difference between Anaconda and a regular Python version?
So you have Anaconda with Python 3.5 and regular Python 2.7 version installed? 
Anaconda do comes with a lot packages pre-installed and 1 of theme is beautifulsoup4.
So why don't you use this 3.5 version?
Quote:Then, I followed "https://www.youtube.com/watch?v=J5YVlMB1m98" to add bs4 folder from "/anaconda/lib/python3.5/site-packages" path to my PyDev project in ecplise. 
Seems like he don't know what he taking about,you don't set path to every module that's installed. 
Just the python executable that you want to use.
He use the old way of installing,these days you just use pip.
Reply
#6
(Jan-09-2017, 06:16 AM)snippsat Wrote: Anaconda with Python 3.5 and regular Python 2.7 version installed
I think I installed Anaconda with Python 3.5 and regular Python 2.7 version installed.
I have seen beautifulsoup4 and pandas in Python 3.5 under Anaconda.
Now I create a new project with 3.5 interpreter. But import pandas/bs4 still does not work
So should I install a regular Python version?

L
Reply
#7
You can just use the Anacoda version.
You most Configure Interpreter to point to /anaconda/lib/python3.5/(choose python).
Reply
#8
(Jan-09-2017, 07:26 AM)snippsat Wrote: You can just use the Anacoda version.
You most Configure Interpreter to point to /anaconda/lib/python3.5/(choose python).

I solved it! The solution is here : https://docs.continuum.io/anaconda/ide_i...-and-pydev

It 's all about how to set my interpreter to Anacoda's Python from my Elipse's setting.

Cheers,

L
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Table data with BeatifulSoup gerry84 11 7,197 Oct-23-2019, 10:09 AM
Last Post: Larz60+
  beatifulsoup scrap td tag. piuk3man 1 3,873 Jun-11-2018, 06:16 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020