zoukankan      html  css  js  c++  java
  • python 中出现的AttributeError: 'module' object has no attribute '_handlerList'

    Traceback (most recent call last):

      File "/usr/local/bin/pip", line 9, in <module>

        load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()

      File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/__init__.py", line 233, in main

        return command.main(cmd_args)

      File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 185, in main

        for name in ["pip._vendor", "distlib", "requests", "urllib3"]

      File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/compat/dictconfig.py", line 565, in dictConfig

        dictConfigClass(config).configure()

      File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/compat/dictconfig.py", line 332, in configure

        del logging._handlerList[:]

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

     

    一.pip 版本升级造成的原因

    升级过后会有 logging-0.4.9.6的在你的/Library/Python/2.7/site-packages/文件夹下的,删除即可。

    二.easy_install 的logging文件

    若是前面第一步完成后还没有解决,继续查看下一步即可,亲

    logging文件也是在/Library/Python/2.7/site-packages/文件夹下

    @Aarushi-Ign You shouldn't have any logging-0.4.9.6, or easy_install logging. The logging module is part of the standard library. What seems to be happening is that your 3rd-party logging module is overriding the stdlib version (that's a fault of easy_install, which puts 3rd party modules ahead of the standard library in PYTHONPATH).

    Try uninstalling all 3rd party logging modules, and that should fix your issue.

    这是翻墙看到的解决方案。

    链接:https://github.com/pypa/pip/issues/3193

     

    若是你还有其他更好解决的方法,或者疑问,请留言。谢谢亲

  • 相关阅读:
    mysql数据库备份脚本
    int main(int argc,char *argv[])参数的应用
    文件I/O实现cp复制功能
    网络通信TCP编程实例代码
    外部碎片、进程描述符、内部碎片
    程序、进程、作业、线程的关系
    word2016怎么从第三页开始设置页码
    ARMs3c2440开发板挂接NFS服务
    u-boot添加一个hello命令
    vi 编辑器跳转到指定行数
  • 原文地址:https://www.cnblogs.com/Hondsome/p/6077178.html
Copyright © 2011-2022 走看看