Python 2.x and Python 3.x with Beautiful Soup Package on Mac OSX 10.9.5

126 views
Skip to first unread message

worldwyn

unread,
Sep 28, 2014, 11:00:06 PM9/28/14
to beauti...@googlegroups.com
I am fairly new to Python and have run into some problems installing Beautiful Soup.  I am running Mac OSX 10.9.5.

I installed and used Python 3.4 during a summer and installed Beautiful Soup 4 for a project.  That installation worked fine.  I am now needing to use Python 2.7 with Beautiful Soup.  Suspecting that I would need to install a different version of Beautiful Soup I went ahead and ran my Python code to be sure.  When my code tries to import bs4 I get an error. Call and error:

from bs4 import BeautifulSoup
ImportError: No module named bs4

However, when I try to install Beautiful Soup from the console within PyCharm where I am using Python 2.7 the installation fails:

pip install beautifulsoup4
Requirement already satisfied

I also tried to install from a new terminal window opened from the Python 2.7 folder in hope that the install would be focused there.  Same result:

MacBook-Pro-i7:Python 2.7 InnoVition$ pip install beautifulsoup4
Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4 in /Applications/anaconda/lib/python3.4/site-packages

Is there some way I can temporarily "hide" the bs4 installation associated with Python 3.4 so the installation to Python 2.7 can proceed?  Any other recommendations?
Message has been deleted

John Hassell

unread,
Jul 23, 2016, 8:25:09 AM7/23/16
to beautifulsoup
I had the same issue. I resolved this issue by selecting a Project Interpreter under Pycharm, specifically Project Interpreter 3.5.2 (this interpreter became available through a configuration of pyenv).
Reply all
Reply to author
Forward
0 new messages