Python beautifulsoup4安装失败,出现redis错误

Python beautifulsoup4安装失败,出现redis错误,python,beautifulsoup,redis,Python,Beautifulsoup,Redis,在Ubuntu 18/python 3.5上。我的beautifulsoup 4安装失败,错误消息中提到redis服务器。我确实在这台机器上安装了redis。不确定为什么bs4安装会被它弄脏(请参阅下面的安装错误)。我试着忽略这个问题,然后运行一个样本bs4测试,结果失败了。不确定失败的解析是否与错误的安装相关 从bs4导入BeautifulSoup html_doc = """ <html><head><title>The Dormouse's story&

在Ubuntu 18/python 3.5上。我的beautifulsoup 4安装失败,错误消息中提到redis服务器。我确实在这台机器上安装了redis。不确定为什么bs4安装会被它弄脏(请参阅下面的安装错误)。我试着忽略这个问题,然后运行一个样本bs4测试,结果失败了。不确定失败的解析是否与错误的安装相关

从bs4导入BeautifulSoup

html_doc = """
<html><head><title>The Dormouse's story</title></head>
"""

soup = BeautifulSoup(html_doc, "html5lib")
print(soup.prettify)

您是否尝试过使用安装bs4?在控制盘文件上使用pip安装,安装时没有出现错误。谢谢
Traceback (most recent call last):
  File "/srv/raiddisk/dev/pythonInterviews/src/HTML_beautsoup.py", line 1, in <module>
    from bs4 import BeautifulSoup
  File "/usr/lib/python3/dist-packages/bs4/__init__.py", line 30, in <module>
    from .builder import builder_registry, ParserRejectedMarkup
  File "/usr/lib/python3/dist-packages/bs4/builder/__init__.py", line 314, in <module>
    from . import _html5lib
  File "/usr/lib/python3/dist-packages/bs4/builder/_html5lib.py", line 70, in <module>
    class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: module 'html5lib.treebuilders' has no attribute '_base'
(venv) marshall@samson:/srv/raiddisk/dev/pythonInterviews$ sudo apt-get install --reinstall python3-bs4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-154 linux-headers-4.4.0-154-generic
  linux-headers-4.4.0-164 linux-headers-4.4.0-164-generic
  linux-modules-4.4.0-164-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 61 not upgraded.
1 not fully installed or removed.
Need to get 64.1 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirrors.cs.umass.edu/ubuntu xenial/main amd64 python3-bs4 all 4.4.1-1 [64.1 kB]
Fetched 64.1 kB in 0s (116 kB/s)     
(Reading database ... 371175 files and directories currently installed.)
Preparing to unpack .../python3-bs4_4.4.1-1_all.deb ...
Unpacking python3-bs4 (4.4.1-1) over (4.4.1-1) ...
Setting up redis-server (2:3.0.6-1ubuntu0.4) ...
Job for redis-server.service failed because the control process exited with error code. See "systemctl status redis-server.service" and "journalctl -xe" for details.
invoke-rc.d: initscript redis-server, action "start" failed.
● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sat 2019-11-09 07:33:59 EST; 6ms ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
  Process: 77504 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)
  Process: 77497 ExecStartPre=/bin/run-parts --verbose /etc/redis/redis-server.pre-up.d (code=exited, status=0/SUCCESS)

Nov 09 07:33:59 samson systemd[1]: Failed to start Advanced key-value store.
Nov 09 07:33:59 samson systemd[1]: redis-server.service: Unit entered faile...e.
Nov 09 07:33:59 samson systemd[1]: redis-server.service: Failed with result...'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package redis-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python3-bs4 (4.4.1-1) ...
Errors were encountered while processing:
 redis-server
E: Sub-process /usr/bin/dpkg returned an error code (1)