BS4 in python 2.7

时间:2017-11-20 17:30:10

标签: python-2.7 beautifulsoup

我最近尝试在我的电脑上安装Python 2.7.13中的BS4。安装过程似乎完美,但当我尝试导入bs4时,我得到: ModuleNotFoundError:没有名为' bs4' 我尝试使用pip和/或easyinstall重新安装它几次。示例如下:

C:\Python27\Scripts>easy_install bs4
Searching for bs4
Reading https://pypi.python.org/simple/bs4/
Downloading 
https://pypi.python.org/packages/10/ed/7e8b97591f6f456174139ec089c76
9f89a94a1a4025fe967691de971f314/bs4-
0.0.1.tar.gz#md5=fe7e51587ac3b174608f3c4f8bd
893ac
Best match: bs4 0.0.1
Processing bs4-0.0.1.tar.gz
Writing c:\users\kloc\appdata\local\temp\easy_install-1g2akp\bs4-
0.0.1\setup.cfg

Running bs4-0.0.1\setup.py -q bdist_egg --dist-dir 
c:\users\kloc\appdata\local\t
emp\easy_install-1g2akp\bs4-0.0.1\egg-dist-tmp-gxksva
warning: install_lib: 'build\lib' does not exist -- no Python modules to 
install


zip_safe flag not set; analyzing archive contents...
Moving bs4-0.0.1-py2.7.egg to c:\python27\lib\site-packages
Adding bs4 0.0.1 to easy-install.pth file

Installed c:\python27\lib\site-packages\bs4-0.0.1-py2.7.egg
Processing dependencies for bs4
Searching for beautifulsoup4
Reading https://pypi.python.org/simple/beautifulsoup4/
Downloading 
https://pypi.python.org/packages/fa/8d/1d14391fdaed5abada4e0f63543fe
f49b8331a34ca60c88bd521bcf7f782/beautifulsoup4-
4.6.0.tar.gz#md5=c17714d0f91a23b7
08a592cb3c697728
Best match: beautifulsoup4 4.6.0
Processing beautifulsoup4-4.6.0.tar.gz
Writing c:\users\kloc\appdata\local\temp\easy_install-dw_u0f\beautifulsoup4-
4.6.
0\setup.cfg
Running beautifulsoup4-4.6.0\setup.py -q bdist_egg --dist-dir 
c:\users\kloc\appd
ata\local\temp\easy_install-dw_u0f\beautifulsoup4-4.6.0\egg-dist-tmp-oxng7i
zip_safe flag not set; analyzing archive contents...
Moving beautifulsoup4-4.6.0-py2.7.egg to c:\python27\lib\site-packages
Adding beautifulsoup4 4.6.0 to easy-install.pth file

Installed c:\python27\lib\site-packages\beautifulsoup4-4.6.0-py2.7.egg
Finished processing dependencies for bs4

使用pip安装也可以正常工作。我也尝试过使用beautifulsoup4-4.6.0-py2-none-any.whl文件。每次它似乎没有问题安装,然后我似乎无法导入它。 BS4文件存在于C:\ Python27 \ Lib \ site-packages中。是的,我已经检查了许多其他答案,但没有任何对我有用。为了增加对伤害的侮辱我昨天设法在我的笔记本电脑上拉了它,没有(很多)麻烦。任何人都可以帮我解决这个问题吗?

0 个答案:

没有答案