zoukankan      html  css  js  c++  java
  • Python No module named pkg_resources

    好记性不如烂笔头。

    I encountered the same ImportError today while trying to use pip. Somehow the setuptools package had been deleted in my Python environment.

    To fix the issue, run the setup script for setuptools:

    wget https://bootstrap.pypa.io/ez_setup.py -O - | python
    

    (or if you don't have wget installed (e.g. OS X), try

    curl https://bootstrap.pypa.io/ez_setup.py | python
    

    possibly with sudo prepended.)

    If you have any version of distribute, or any setuptools below 0.6, you will have to uninstall it first.*

    See Installation Instructions for further details.


    * If you already have a working distribute, upgrading it to the "compatibility wrapper" that switches you over to setuptools is easier. But if things are already broken, don't try that.

    Try these:

    # Get rid of them
    $ python -m pip uninstall -y setuptools
    $ python -m pip uninstall -y distribute
    # the next command should FAIL now because the above should be uninstalled
    $ python -c "import pkg_resources"
    # reinstall stuff now
    $ python -m pip install -U --force-reinstall setuptools
    $ python -m pip install -U --force-reinstall pip
    # now check things work and are the same
    $ python -m pip --version
    $ pip --version
    $ pip list



    referer:
    http://bird.so/search?q=No%20module%20named%20pkg_resources
    https://github.com/pypa/pip/issues/1800
  • 相关阅读:
    什么是高可用?
    URL中两种方式传参
    Flask基本环境配置
    爬虫urlib库的一些用法
    HTML第一部分
    python中递归题
    python中重要的内置函数
    关于生成器中的send,应用移动平均值,以及yield from
    python中装饰器进阶
    一些作业
  • 原文地址:https://www.cnblogs.com/sevck/p/7754597.html
Copyright © 2011-2022 走看看