zoukankan      html  css  js  c++  java
  • pip install 报错

    前景,pymysql,pysftp这类库已经pip install 但运行脚本时还是提示没有模块
    于是
    pip install --upgrade pip 升级了一下
    然后再次pip时就出现了一堆报错

    Exception:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2795, in _dep_map
        return self.__dep_map
      File "/usr/local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2652, in __getattr__
        raise AttributeError(attr)
    AttributeError: _DistInfoDistribution__dep_map
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/local/lib/python3.5/site-packages/pip/basecommand.py", line 211, in main
        status = self.run(options, args)
      File "/usr/local/lib/python3.5/site-packages/pip/commands/install.py", line 294, in run
        requirement_set.prepare_files(finder)
      File "/usr/local/lib/python3.5/site-packages/pip/req/req_set.py", line 334, in prepare_files
        functools.partial(self._prepare_file, finder))
      File "/usr/local/lib/python3.5/site-packages/pip/req/req_set.py", line 321, i
    
     ERROR: Command errored out with exit status 1:
         command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f3uSbo/subprocess32/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f3uSbo/subprocess32/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
    '"'"', '"'"'
    '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-f3uSbo/subprocess32/pip-egg-info
             cwd: /tmp/pip-install-f3uSbo/subprocess32/
        Complete output (19 lines):
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-install-f3uSbo/subprocess32/setup.py", line 120, in <module>
            main()
          File "/tmp/pip-install-f3uSbo/subprocess32/setup.py", line 114, in main
            'Programming Language :: Python :: Implementation :: CPython',
          File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
            _setup_distribution = dist = klass(attrs)
          File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
            _Distribution.__init__(self,attrs)
          File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
            self.finalize_options()
          File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 302, in finalize_options
            ep.load()(self, ep.name, value)
          File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2316, in load
            return self.resolve()
          File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2326, in resolve
            raise ImportError(str(exc))
        ImportError: 'module' object has no attribute 'check_specifier'
        ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs 
    

    处理办法: 升级库

    python -m pip install --upgrade setuptools
    pip install matplotlib --upgrade
    # 升级后再去pip isntall 就不再报错
    pip3 install pysftp
    
  • 相关阅读:
    【bzoj题解】2186 莎拉公主的困惑
    【算法学习】整体二分
    【算法学习】【洛谷】cdq分治 & P3810 三维偏序
    【比赛游记】NOIP2017游记
    【0】如何在电脑中使用多个python版本【python虚拟环境配置】
    Mysql 安装服务无法启动解决方案与使用的一般使用指令
    4-urllib库添加代理,添加请求头格式 模板
    3-urllib的post请求方式
    02-urllib库的get请求方式
    01-urllib库添加headers的一般方法
  • 原文地址:https://www.cnblogs.com/sihye/p/12636225.html
Copyright © 2011-2022 走看看