很久一段时间没有更新Pycharm当中的package了,今天打开Pycharm点击package更新,发生了错误,AttributeError:module 'pip' has no attribute 'main',如图所示:

  按照网上其他网友所介绍的解决方案是,找到Pychram安装目录下 helpers/packaging_tool.py文件,找到如下代码:

  将上述两个方法的代码改动一下,如图所示:

  其实这个是不完整的,你会发现更新的时候还是报错了,没有把代码看完整,下面的那个return的pip已经没有用了,所以需要去除掉,否则会报:NameError: name 'pip' is not defined  错误。如图所示:

  最终代码修改如下:

PS:如有疑问,请留言,未经允许,不得私自转载,转载请注明出处:https://www.cnblogs.com/xuliangxing/p/9615957.html

 

解决Pycharm更新package出现的问题:AttributeError:module 'pip' has no attribute 'main'的更多相关文章

  1. Pycharm安装package报错:AttributeError: module 'pip' has no attribute 'main'

    Pycharm安装package报错:AttributeError: module 'pip' has no attribute 'main' 确认pip已经升级到目前最新版本了. 在网上搜寻后,解决 ...

  2. [已解决]pycharm报错:AttributeError: module 'pip' has no attribute 'main'

    > 更新pip后,pycharm更新模块报错,经过一番查找,现提供两种解决办法. 报错片段信息如下: AttributeError: module 'pip' has no attribute ...

  3. Jupiter 页面环境下使用pip无法安装(AttributeError: module 'pip' has no attribute 'main')

    异常: AttributeError Traceback (most recent call last) <ipython-input-5-880e5dfa627c> in <mod ...

  4. 【pycharm】pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法

    pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法 解决方法: 在pycharm的安装目 ...

  5. Python 3.6安装yaml时报"AttributeError: module 'pip' has no attribute 'main'"和“Non-zero exit code”错误

    1.Python 3.6安装yaml时一开始报AttributeError: module 'pip' has no attribute错误,根据网上提供的解决方法修改Pycharm安装目录D:\Pr ...

  6. 解决pycharm报错:AttributeError: module 'pip' has no attribute 'main'

    找到pycharm安装目录下 helpers/packaging_tool.py文件,找到如下代码: def do_install(pkgs): try: import pip except Impo ...

  7. pycharm安装 suds模块报错:AttributeError: module 'pip' has no attribute 'main'

    需求:安装suds模块 遇到的问题: 一.报错信息:[file][Default Settint]---Project Interpreter 点击 搜索suds安装模块报错 解决:依据上图提示找到C ...

  8. Pycharm 报错 AttributeError: module 'pip' has no attribute 'main'

    1.打开文件packaging_tool.py: D:\Program files\pycharm\PyCharm 2016.3.2\helpers\packaging_tool.py 2.添加导入: ...

  9. AttributeError: module 'pip' has no attribute 'main'

    Pycharm在运行pip安装模块是报错如下: 解决方法: 找到安装路径下的packaging_tool.py文件修改如下: 我的路径为D:\Program Files\JetBrains\PyCha ...

随机推荐

  1. python之property属性

    Property的概念:property是一种特殊的属性,访问它时会执行一段功能(函数),然后返回值. import math class Circle: def __init__(self,radi ...

  2. OPC_Data Access Automation Interface Standard V2.02

    文库地址: https://wenku.baidu.com/view/a70d1ad4b14e852458fb57da.html

  3. elastic-job详解(一):数据分片

    数据分片的目的在于把一个任务分散到不同的机器上运行,既可以解决单机计算能力上限的问题,也能降低部分任务失败对整体系统的影响.elastic-job并不直接提供数据处理的功能,框架只会将分片项分配至各个 ...

  4. Servlet(1)—Servlet容器tomcat和HTTP协议

    Servlet容器为JavaWeb应用提供运行时环境,它负责管理Servlet和JSP的生命周期,以及管理他们的共享数据. Servlet容器也称JavaWeb应用容器,或者Servlet/JSP容器 ...

  5. JavaScript JSON对象(一)

    一.JSON数据 JSON(JavaScript Object Notation,JavaScript对象表示法)是一种轻量级的数据交换格式. JSON是“名值对”的集合.结构由大括号'{}',中括号 ...

  6. Ubuntu安装最新版nodejs

    今天在学习以太坊时,需要用到nodejs,因为使用的是ubuntu 16.04 LTS,一直安装的是老版本的nodejs,官方给方法用不成,折腾了半天,什么软链.手动编译,总觉得不很靠谱(linux水 ...

  7. shiro-过滤器

    http://shiro.apache.org/authorization.html#Authorization-PermissionGranularity shiro默认的过滤器 Shiro内置了很 ...

  8. grid - 隐式命名网格线名称

    1.隐式的指定网格线反向指定了隐式的网格区域名称,命名的网格区域隐式的命名了网格线名称. 指定网格区域会给网格区域边线添加隐式的网格线名称.这些网格线的命名是基于网格区域来命名,只是在网格区域名称的后 ...

  9. ubuntu install google-chrome-stable

    google-chrome-stable is available on a 3rd Party Repository: Google Chrome (for Stable). Follow the ...

  10. CentOS 7 安装 Oracle 11.2.0.4

    一.安装环境 CentOS Linux release 7.2.1511 (Core) Oracle Database 11g Release 2 (11.2.0.4) 二.安装前准备 2.1 修改主 ...