Note that there are some explanatory texts on larger screens.

plurals
  1. POPython-Failure to import BeautifulSoup4 in Python3.3.1, but success in Python 2.7-Installed using easy_install
    primarykey
    data
    text
    <p><strong>Background &amp; What I did:</strong> I'm writing a webpage content extractor, and realized the need to install BeautifulSoup4 to better parse my HTML file. On my Ubuntu 13.04 machine, I have both Python2.7(system default) and Python3.3.1 installed. After a few failures with both <code>pip</code> and <code>easy_install</code> due to the "SSL certificate" issue, I got to finally install BeautifulSoup4 using easy_install on my last try. </p> <p><strong>But:</strong> It seems that <code>easy_install</code> installed BS4 into the Python2.7 directory(<code>/usr/local/lib/python2.7/dist-packages</code>) in my system, as you can tell from the information below: </p> <pre><code>Searching for beautifulsoup4 Reading http://pypi.python.org/simple/beautifulsoup4/ Best match: beautifulsoup4 4.2.1 Downloading https://pypi.python.org/packages/source/b/beautifulsoup4/beautifulsoup4-4.2.1.tar.gz#md5=91ea70ce16a5f1f43e58f2ef05651679 Processing beautifulsoup4-4.2.1.tar.gz Writing /tmp/easy_install-OLXNjV/beautifulsoup4-4.2.1/setup.cfg Running beautifulsoup4-4.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-OLXNjV/beautifulsoup4-4.2.1/egg-dist-tmp-SpupH8 zip_safe flag not set; analyzing archive contents... Adding beautifulsoup4 4.2.1 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/beautifulsoup4-4.2.1-py2.7.egg </code></pre> <p>Right now I'm able to import BS4 in Python2.7, but not in Python3.3, with this error message: </p> <pre><code>&gt;&gt;&gt; import bs4 Traceback (most recent call last): File "&lt;pyshell#8&gt;", line 1, in &lt;module&gt; import bs4 ImportError: No module named 'bs4' </code></pre> <p><strong>Question:</strong> Should I add this Python2.7 directory to my Python3.3 library directory? (I worry about future conflict of different versions of a same module due to this shared library path) or should I uninstall BS4 and try it again with <code>pip</code> so maybe it'll install BS4 in Python3.3 directory? (right now this got returned when I try to install BS4 again using <code>pip</code>: <code>Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4 in ./beautifulsoup4-4.2.1-py2.7.egg</code>) Other general pointers about solving this problem will also be appreciated. Thank you! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload