Question

I used the command pip install beautifulsoup4 to install beautifulsoup, however, after I tried to import it and failed I found something interesting, there is just egg-info folder but no scripts folder, can anybody tell me why and how to solve this? I know I can just get the script and move it to sitepackages folder and I did like that and it works but I feel it's bad idea.

Was it helpful?

Solution

When you install beautifulsoup4 with pip, you are installing a distribution by that name. The .egg-info folder pip creates when installing that distribution is named after the distribution (plus the version and python architecture).

The distribution contains one or more packages or modules, and these are installed into the site-packages folder next to the .egg-info directory. The names of these packages or modules do not necessarily correspond to the distribution name.

For BeautifulSoup 4, the distribution contains one package named bs4.

You can verify this for yourself; inside the .egg-info directory is a file named installed-files.txt, listing all associated files (using relative paths):

$ cat lib/python2.7/site-packages/beautifulsoup4*.egg-info/installed-files.txt
../bs4/__init__.py
../bs4/dammit.py
../bs4/diagnose.py
../bs4/element.py
../bs4/testing.py
../bs4/builder/__init__.py
../bs4/builder/_html5lib.py
../bs4/builder/_htmlparser.py
../bs4/builder/_lxml.py
../bs4/tests/__init__.py
../bs4/tests/test_builder_registry.py
../bs4/tests/test_docs.py
../bs4/tests/test_html5lib.py
../bs4/tests/test_htmlparser.py
../bs4/tests/test_lxml.py
../bs4/tests/test_soup.py
../bs4/tests/test_tree.py
../bs4/__init__.pyc
../bs4/dammit.pyc
../bs4/diagnose.pyc
../bs4/element.pyc
../bs4/testing.pyc
../bs4/builder/__init__.pyc
../bs4/builder/_html5lib.pyc
../bs4/builder/_htmlparser.pyc
../bs4/builder/_lxml.pyc
../bs4/tests/__init__.pyc
../bs4/tests/test_builder_registry.pyc
../bs4/tests/test_docs.pyc
../bs4/tests/test_html5lib.pyc
../bs4/tests/test_htmlparser.pyc
../bs4/tests/test_lxml.pyc
../bs4/tests/test_soup.pyc
../bs4/tests/test_tree.pyc
./
dependency_links.txt
PKG-INFO
SOURCES.txt
top_level.txt
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top