ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

linux下pip install bs4报错

2021-09-10 15:34:42  阅读:854  来源: 互联网

标签:bs4 0.0 4.9 报错 pip beautifulsoup4 packages


1 报错信息如下

$ sudo pip install bs4==0.0.1
Collecting bs4==0.0.1
  Downloading http://pip.pgw.getui.com/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Collecting beautifulsoup4 (from bs4==0.0.1)
  Downloading http://pip.pgw.getui.com/packages/a1/69/daeee6d8f22c997e522cdbeb59641c4d31ab120aba0f2c799500f7456b7e/beautifulsoup4-4.10.0.tar.gz (399kB)
    100% |████████████████████████████████| 409kB 11.7MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-USqeae/beautifulsoup4/setup.py", line 7, in <module>
        from bs4 import __version__
      File "bs4/__init__.py", line 36, in <module>
        raise ImportError('You are trying to use a Python 3-specific version of Beautiful Soup under Python 2. This will not work. The final version of Beautiful Soup to support Python 2 was 4.9.3.')
    ImportError: You are trying to use a Python 3-specific version of Beautiful Soup under Python 2. This will not work. The final version of Beautiful Soup to support Python 2 was 4.9.3.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-USqeae/beautifulsoup4/

2 解决办法

先安装beautifulsoup4

$ sudo  pip install beautifulsoup4==4.9.0
Collecting beautifulsoup4==4.9.0
  Downloading http://pip.pgw.getui.com/packages/2d/3e/8b2fc5d3c31c84d7209313f4059858f502f2e4a9d986693eca03fe325565/beautifulsoup4-4.9.0-py2-none-any.whl (109kB)
    100% |████████████████████████████████| 112kB 872kB/s
Collecting soupsieve<2.0 (from beautifulsoup4==4.9.0)
  Downloading http://pip.pgw.getui.com/packages/39/36/f35056eb9978a622bbcedc554993d10777e3c6ff1ca24cde53f4be9c5fc4/soupsieve-1.9.6-py2.py3-none-any.whl
Collecting backports.functools-lru-cache; python_version < "3" (from soupsieve<2.0->beautifulsoup4==4.9.0)
  Downloading http://pip.pgw.getui.com/packages/e5/c1/1a48a4bb9b515480d6c666977eeca9243be9fa9e6fb5a34be0ad9627f737/backports.functools_lru_cache-1.6.4-py2.py3-none-any.whl
Installing collected packages: backports.functools-lru-cache, soupsieve, beautifulsoup4
Successfully installed backports.functools-lru-cache-1.6.4 beautifulsoup4-4.9.0 soupsieve-1.9.6

在安装bs4

$ sudo  pip install  bs4==0.0.1
Collecting bs4==0.0.1
  Downloading http://pip.pgw.getui.com/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4 in /usr/lib/python2.7/site-packages (from bs4==0.0.1)
Requirement already satisfied (use --upgrade to upgrade): soupsieve<2.0 in /usr/lib/python2.7/site-packages (from beautifulsoup4->bs4==0.0.1)
Requirement already satisfied (use --upgrade to upgrade): backports.functools-lru-cache; python_version < "3" in /usr/lib/python2.7/site-packages (from soupsieve<2.0->beautifulsoup4->bs4==0.0.1)
Installing collected packages: bs4
  Running setup.py install for bs4 ... done
Successfully installed bs4-0.0.1

标签:bs4,0.0,4.9,报错,pip,beautifulsoup4,packages
来源: https://blog.csdn.net/qq_35440040/article/details/120222996

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有