我一直在尝试在虚拟环境中安装使用美丽的汤。我已经使用 pip 和 easy_install 成功安装了模块,但我似乎无法将它导入解释器。这是我为尝试启动它所做的工作。任何帮助将不胜感激。
谢谢!
(WebScraper)test@ubuntu:~/code/WebScraper$ easy_install beautifulsoup4
Searching for beautifulsoup4
Reading http://pypi.python.org/simple/beautifulsoup4/
Reading http://www.crummy.com/software/BeautifulSoup/bs4/
Reading http://www.crummy.com/software/BeautifulSoup/bs4/download/
Best match: beautifulsoup4 4.2.0
Downloading http://pypi.python.org/packages/source/b/beautifulsoup4/beautifulsoup4- 4.2.0.tar.gz#md5=48a3a7ee42d9b5bd046b3b5c86bb2d35
Processing beautifulsoup4-4.2.0.tar.gz
Writing /tmp/easy_install-R6wbsM/beautifulsoup4-4.2.0/setup.cfg
Running beautifulsoup4-4.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install- R6wbsM/beautifulsoup4-4.2.0/egg-dist-tmp-xIc3Vf
zip_safe flag not set; analyzing archive contents...
Adding beautifulsoup4 4.2.0 to easy-install.pth file
Installed /home/test/code/WebScraper/lib/python2.7/site-packages/beautifulsoup4-4.2.0- py2.7.egg
Processing dependencies for beautifulsoup4
Finished processing dependencies for beautifulsoup4
(WebScraper)test@ubuntu:~/code/WebScraper$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bs4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "bs4.py", line 1, in <module>
from bs4 import BeautifulSoup
ImportError: cannot import name BeautifulSoup
>>>>