我正在尝试设置BeautifulSoup4,以便能够运行以下操作:
from bs4 import BeautifulSoup
然而,当我去安装BeautifulSoup4时,我会得到以下内容:
Defaulting to user installation because normal site-packages is not writeable.
Requirement already satisfied: beautifulsoup4 in ./Library/Python/2.7/lib/python/site-packages (4.8.2)
Requirement already
我正在运行我的Python文件。(py name.py)
from bs4 import BeautifulSoup as BS
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\bs4\__init__.py", line 29, in <module>
from .builder import builder_registry
File "C:\Users\Administrator\AppData\Local
使用from bs4 import BeautifulSoup执行脚本会产生以下错误:
Traceback (most recent call last):
File "C:\Users\Stewart\Desktop\dorkscan.py", line 13, in <module>
from bs4 import BeautifulSoup
File "C:\PentestBox\base\python\Lib\site-packages\bs4\__init__.py", line 53
'You ar
导入bs4时出现了一个奇怪的错误。我在别的地方找不到任何帮助。我试着安装html和未来。
完全回溯:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\bs4\__init__.py", line 35, in <module>
from .builder import builder_registry, ParserRejectedMarkup
更新:感谢所有回复和评论的人。我现在知道我已经安装了两个版本的python。我的程序是从"Miniconda3/python.exe“运行的。而bs4安装在"c:\python38\lib\site-packages“中。我知道这是问题的原因。我删除了Minicoda3,但VS代码在我运行程序时仍然尝试使用它。我该如何解决这个问题呢? 当我运行以下代码时: >>> from bs4 import BeautifulSoup 错误: I get the error: "No module named 'bs4'.
After I in
我将bs4导入为:
from bs4 import BeautifulSoup
但它会抛出如下错误:
Traceback (most recent call last):
File "/Users/koudai232/Desktop/test.py", line 4, in <module>
from bs4 import BeautifulSoup
File "/usr/local/lib/python3.6/site-packages/bs4/__init__.py", line 30, in <module>
Traceback (most recent call last): File "urlgrabber.py", line 1, in <module>
from bs4 import BeautifulSoup File "/Users/asdf/Desktop/Scraper/bs4/__init__.py", line 29, in <module>
from .builder import builder_registry File "/Users/asdf/Desktop/Scraper/bs
我已经成功地在我的系统上安装了bs4 (使用python setup.py install)。现在的问题是,在python中导入BeautifulSoup时,我得到了以下错误:
C:\Users\dipankar>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more inf
Python3.4.3 (64位) Windows 7--我的bs4 4/请求运行良好--然后我从我的程序bs1.py获得了所有这些内容:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2218, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'
During handling of the abov
我想在访问网站后获得一些链接。在导入BeautifulSoup时,我得到了以下错误。 Traceback (most recent call last):
File "e:/User/Python/CF.py", line 3, in <module>
from bs4 import BeautifulSoup
File "C:\Users\CP\AppData\Local\Programs\Python\Python38\lib\site-packages\bs4\__init__.py", line 29, in <mod
我已经为Python安装了漂亮的汤,但是当我导入库时,它给了我这个错误:
Traceback (most recent call last):
File "D:/Playroom/WebScraper_01.py", line 2, in <module>
from bs4 import BeautifulSoup
File "C:\Python\lib\site-packages\bs4\__init__.py", line 29, in <module>
from .builder import builder
我已经安装了Python3.5和Beautifulsoup4。当我尝试导入bs4时,我得到下面的错误。有什么办法解决这个问题吗?或者我应该只安装Python 3.4?请非常明确-我是编程新手。非常感谢!
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python 3.5\lib\sit-packages\bs4\__init__.py", line 30, in <module>
from .b
我是在一个系统工作,我没有管理的权利。我在本地环境中安装了python3、pip3和bs4。默认系统python2.6似乎也安装了一个漂亮的汤包。因此,我的Python代码试图获取bs4,并最终获得python2.6。
我的代码是:
try:
from bs4 import BeautifulSoup
except ImportError as err:
print("BeautifulSoup is not installed. To install it use apt-get install python-bs4 or visit https://www.crum
我使用pip和pip3安装了pip3。当我运行Python时,我得到:
从'/Users/myUserName/Desktop/Dev/virtual_env/lib/python3.10/site-packages/bs4/init.py'>导入bs4打印(Bs4)<模块'bs4‘
但是,当我在IDE (崇高)中尝试相同的东西时,我得到了:
ModuleNotFoundError: No module named 'bs4'
我很困惑,之后我下载了熊猫,它在我的IDE中运行得很好。有什么解决这个问题的建议吗?还是我只是尝试另一个网络抓取工具
我已经安装了bs4,它在cmd中运行得很好,如下所示
C:\Users\Ronium>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from bs4 import BeautifulSoup
&