V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
dreampython
V2EX  ›  Python

pip 安装 bleach 报错,求助

  •  
  •   dreampython · 2018-02-21 11:29:16 +08:00 · 3425 次点击
    这是一个创建于 2469 天前的主题,其中的信息可能已经有所发展或是发生改变。

    pyton 2.7.5 执行 pip install bleach 报错,没找出来什么原因导致的问题,请大家帮忙看看,主要日志如下:

      Downloading from URL https://pypi.python.org/packages/85/3e/cf449cf1b5004e87510b9368e7a5f1acd8831c2d6691edd3c62a0823f98f/html5lib-1.0.1.tar.gz#md5=942a0688d6bdf20d087c9805c40182ad (from https://pypi.python.org/simple/html5lib/)
      Running setup.py egg_info for package html5lib
    
        Traceback (most recent call last):
    
          File "<string>", line 16, in <module>
    
          File "/root/maodou/venv/build/html5lib/setup.py", line 54, in <module>
    
            MarkerEvaluation = pkg_resources.MarkerEvaluation
    
        AttributeError: 'module' object has no attribute 'MarkerEvaluation'
    
        Complete output from command python setup.py egg_info:
    
        Traceback (most recent call last):
    
      File "<string>", line 16, in <module>
    
      File "/root/maodou/venv/build/html5lib/setup.py", line 54, in <module>
    
        MarkerEvaluation = pkg_resources.MarkerEvaluation
    
    AttributeError: 'module' object has no attribute 'MarkerEvaluation'
    
    ----------------------------------------
    
    Cleaning up...
    
      Removing temporary dir /root/maodou/venv/build...
    Command python setup.py egg_info failed with error code 1 in /root/maodou/venv/build/html5lib
    
    Exception information:
    Traceback (most recent call last):
      File "/root/maodou/venv/lib/python2.7/site-packages/pip/basecommand.py", line 134, in main
        status = self.run(options, args)
      File "/root/maodou/venv/lib/python2.7/site-packages/pip/commands/install.py", line 236, in run
        requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
      File "/root/maodou/venv/lib/python2.7/site-packages/pip/req.py", line 1134, in prepare_files
        req_to_install.run_egg_info()
      File "/root/maodou/venv/lib/python2.7/site-packages/pip/req.py", line 259, in run_egg_info
        command_desc='python setup.py egg_info')
      File "/root/maodou/venv/lib/python2.7/site-packages/pip/util.py", line 670, in call_subprocess
        % (command_desc, proc.returncode, cwd))
    InstallationError: Command python setup.py egg_info failed with error code 1 in /root/maodou/venv/build/html5lib
    
    6 条回复    2018-02-21 13:59:56 +08:00
    dreampython
        1
    dreampython  
    OP
       2018-02-21 11:36:17 +08:00
    单独安装 html5lib,执行 pip install html5lib,报错如下:
    <pre>
    ------------------------------------------------------------
    /root/maodou/venv/bin/pip run on Wed Feb 21 11:33:50 2018
    Downloading/unpacking html5lib
    。。。。
    Running setup.py egg_info for package html5lib

    Traceback (most recent call last):

    File "<string>", line 16, in <module>

    File "/root/maodou/venv/build/html5lib/setup.py", line 54, in <module>

    MarkerEvaluation = pkg_resources.MarkerEvaluation

    AttributeError: 'module' object has no attribute 'MarkerEvaluation'

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

    File "<string>", line 16, in <module>

    File "/root/maodou/venv/build/html5lib/setup.py", line 54, in <module>

    MarkerEvaluation = pkg_resources.MarkerEvaluation

    AttributeError: 'module' object has no attribute 'MarkerEvaluation'

    ----------------------------------------

    Cleaning up...

    Removing temporary dir /root/maodou/venv/build...
    Command python setup.py egg_info failed with error code 1 in /root/maodou/venv/build/html5lib

    Exception information:
    Traceback (most recent call last):
    File "/root/maodou/venv/lib/python2.7/site-packages/pip/basecommand.py", line 134, in main
    status = self.run(options, args)
    File "/root/maodou/venv/lib/python2.7/site-packages/pip/commands/install.py", line 236, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
    File "/root/maodou/venv/lib/python2.7/site-packages/pip/req.py", line 1134, in prepare_files
    req_to_install.run_egg_info()
    File "/root/maodou/venv/lib/python2.7/site-packages/pip/req.py", line 259, in run_egg_info
    command_desc='python setup.py egg_info')
    File "/root/maodou/venv/lib/python2.7/site-packages/pip/util.py", line 670, in call_subprocess
    % (command_desc, proc.returncode, cwd))
    InstallationError: Command python setup.py egg_info failed with error code 1 in /root/maodou/venv/build/html5lib
    </pre>
    guyskk0x0
        2
    guyskk0x0  
       2018-02-21 11:46:26 +08:00 via Android
    是不是 pip/setuptools 版本太低了,装最新版试试
    Showfom
        3
    Showfom  
       2018-02-21 11:49:12 +08:00
    pip install --upgrade pip
    pip install --upgrade setuptools

    更新一下先
    fxxkgw
        4
    fxxkgw  
       2018-02-21 12:12:38 +08:00 via iPhone
    除了版本问题,基本上遇到的 pip 安装报错都是依赖的 devel 找不到,这种错误拿关键字去 google 里搜应该都可以找到。。
    dreampython
        5
    dreampython  
    OP
       2018-02-21 12:47:05 +08:00
    问题已解决,解决方法是按照 @guyskk0x0 @Showfom 的方法,升级了 pip 和 setuptools 之后再执行 pip install bleach 后安装成功,感谢
    Showfom
        6
    Showfom  
       2018-02-21 13:59:56 +08:00
    @dreampython 这是基本操作=。=
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1212 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:19 · PVG 07:19 · LAX 15:19 · JFK 18:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.