AttributeError: module 'pip' has no attribute 'main报错

  • 找到安装目录下 helpers/packaging_tool.py文件,找到如下代码:
    
    def do_install(pkgs):
    try:
    import pip
    except ImportError:
    error_no_pip()
    return pip.main(['install'] + pkgs) def do_uninstall(pkgs):
    try:
    import pip
    except ImportError:
    error_no_pip()
    return pip.main(['uninstall', '-y'] + pkgs)

    修改为如下,保存即可。

    def do_install(pkgs):
    try:
    # import pip
    try:
    from pip._internal import main
    except Exception:
    from pip import main
    except ImportError:
    error_no_pip()
    return main(['install'] + pkgs) def do_uninstall(pkgs):
    try:
    # import pip
    try:
    from pip._internal import main
    except Exception:
    from pip import main
    except ImportError:
    error_no_pip()
    return main(['uninstall', '-y'] + pkgs)


  • 在下载python库的时候,由于国内网络原因,python包的下载速度非常慢,查看pip 文档,只要在 pip的时候控制超时即可, 具体参数为 --default-timeout=100, 后面的时间可以自己指定。
  • 解决方法
  • pip --default-timeout=100 install gevent


python pip报错pip._ vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.的更多相关文章

  1. 解决pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

    参考链接[侵权删] https://www.jianshu.com/p/3378fa827924 https://yq.aliyun.com/articles/619208 问题描述:在Windows ...

  2. 错误:pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

    pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', ...

  3. pip安装超时问题-pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

    手动设置延时:(推荐) pip --default-timeout=100 install nibabel --或者不使用缓存pip  --no-cache-dir install Pillow 更改 ...

  4. 解决pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.问题

    国内的其他镜像源清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/阿里云 http://mirrors.aliyun.com/pypi/simple/中国科技 ...

  5. 安装SpaCy出现报错:requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443):

    内含安装步骤及报错解决:https://www.cnblogs.com/xiaolan-Lin/p/13286885.html

  6. pip pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool

    设置超时时间: pip --default-timeout=100 install  Pillow

  7. python2.7使用requests时报错SSLError: HTTPSConnectionPool(host='b-ssl.duitang.com', port=443)

    import requests url='https://www.duitang.com/napi/blog/list/by_search/?kw=%E6%A0%A1%E8%8A%B1&sta ...

  8. 解决python爬虫requests.exceptions.SSLError: HTTPSConnectionPool(host='XXX', port=443)问题

    爬虫时报错如下: requests.exceptions.SSLError: HTTPSConnectionPool(host='某某某网站', port=443): Max retries exce ...

  9. 【Selenium】【BugList4】执行pip报错:Fatal error in launcher: Unable to create process using '""D:\Program Files\Python36\python.exe"" "D:\Program Files\Python36\Scripts\pip.exe" '

    环境信息: python版本:V3.6.4 安装路径:D:\Program Files\python36 环境变量PATH:D:\Program Files\Python36;D:\Program F ...

随机推荐

  1. sde自动备份到文件gdb

    本方法原理是使用python(以下简称py)调用arcmap的gp,在上再用bat调用py的方式实现.优点是能应用于所有数据库类型(包括pg,oracle等)的sde库 环境:arcmap 10.4, ...

  2. Robot Framework 源码阅读 day1 run.py

    robot里面run起来的接口主要有两类 run_cli def run_cli(arguments): """Command line execution entry ...

  3. 2019-3-6-WPF-使用-SharpDX

    title author date CreateTime categories WPF 使用 SharpDX lindexi 2019-03-06 16:52:37 +0800 2018-4-20 9 ...

  4. 1-基于Xilinx XCKU115的半高PCIe x8 硬件加速卡

    基于Xilinx XCKU115的半高PCIe x8 硬件加速卡 一.概述 本板卡系我公司自主研发,采用Xilinx公司的XCKU115-3-FLVF1924-E芯片作为主处理器,主要用于FPGA硬件 ...

  5. 记一次在mac上源码编译curl,使其支持NSS的过程

    一.背景 在一次学习https原理的过程中,希望客户端指定特定的cipher suites来抓包分析SSL/TLS的握手过程,就想到了使用curl工具,而不是使用浏览器. 接下来使用man curl找 ...

  6. RAS

    Reliability 高可靠性 Availability 高可用性 Serviceability 高服务性

  7. linux环境进程开机自检脚本

    Linux下shell脚本监控Tomcat的状态并实现自动启动 最近公司需要在Linux下监控tomcat的服务,一旦tomcat服务存在异常或者宕机,重启tomcat保证服务的正常运行,由于Linu ...

  8. springCloud 服务提供者应返回的统一的数据格式

    package com.zledu.commonentity.entity; import lombok.AllArgsConstructor;import lombok.Data; import j ...

  9. JavaWeb(四):JDBC

    数据持久化(persistence) 把数据保存到可掉电式存储设备中以供之后使用. 大多数情况下,特别是企业级应用,数据持久化意味着将内存中的数据保存到硬盘上加以”固化”,而持久化的实现过程大多通过各 ...

  10. [洛谷 P1377] TJOI2011 树的序

    问题描述 众所周知,二叉查找树的形态和键值的插入顺序密切相关.准确的讲:1.空树中加入一个键值k,则变为只有一个结点的二叉查找树,此结点的键值即为k:2.在非空树中插入一个键值k,若k小于其根的键值, ...