Pycharm在运行pip安装模块是报错如下:

解决方法:

找到安装路径下的packaging_tool.py文件修改如下:

我的路径为D:\Program Files\JetBrains\PyCharm 2017.2.3\helpers\packaging_tool.py

原先:

修改后保存退出即可:

代码如下:

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

注意:return 没有pip,然后缩进的问题。

AttributeError: module 'pip' has no attribute 'main'的更多相关文章

  1. 解决Pycharm更新package出现的问题:AttributeError:module 'pip' has no attribute 'main'

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

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

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

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

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

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

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

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

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

  6. 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 ...

  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. 解决pycharm报错:AttributeError: module 'pip' has no attribute 'main'

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

随机推荐

  1. RESTful-4使用教程

    一.REST起源REST(Representational State Transfer)表象化状态转变(表述性状态转变),在2000年被提出,基于HTTP.URI.XML.JSON等标准和协议,支持 ...

  2. setOnTouchListener在小米手机中不走ACTION_UP而是走ACTION_CANCEL

    单点触控: MotionEvent.ACTION_DOWN:手指 初次接触到屏幕 时触发. MotionEvent.ACTION_MOVE:手指 在屏幕上滑动 时触发,会多次触发. MotionEve ...

  3. C# 0xC0000005 捕获

    [HandleProcessCorruptedStateExceptions]//捕获c++异常 [SecurityCritical]//捕获c++异常 public void xxx() { try ...

  4. 2018-2019-2 网络对抗技术 20162329 Exp6 信息搜集与漏洞扫描

    目录 Exp6 信息搜集与漏洞扫描 一.实践原理 1. 间接收集 2. 直接收集 3. 社会工程学 二.间接收集 1. Zoomeye 2. FOFA 3. GHDB 4. whois 5. dig ...

  5. 电梯模拟系统——BUAA OO第二单元作业总结

    需求分析 官方需求 本次作业需要模拟一个多线程实时多电梯系统,从标准输入中输入请求信息,程序进行接收和处理,模拟电梯运行,将必要的运行信息通过输出接口进行输出. 本次作业电梯系统具有的功能为:上下行, ...

  6. vue-cli利用router创建单页面

    一.创建脚手架 第一步 打开命令输入vue init webpack-simple vue-name 下载webpack-simple  (vue-name是你要创建的项目名称) 第二步 输入cd v ...

  7. 181102 Python环境搭建(安装Sublime Text3)

    利用Pycharm来编写.执行python代码是一个不错的选择,Pycharm的安装的确也很方便.但是偶然看到别人用Sublime Text来编写.执行代码,觉得很酷.所以自己动手搭建环境. 1. 下 ...

  8. sql查询优化策略

    Sql语句执行顺序: 查询的逻辑执行顺序 (1) FROM left_table (3) join_type JOIN right_table (2) ON join_condition (4) WH ...

  9. centos 踩坑集锦

    定时任务 top 命令添加定时任务无效 我通过以下命令获取总进程数与僵尸进程数 vim procs.sh procs_total=`/bin/top -n 1|grep Tasks|sed 's/,/ ...

  10. [LeetCode] Inorder Successor in BST II 二叉搜索树中的中序后继节点之二

    Given a binary search tree and a node in it, find the in-order successor of that node in the BST. Th ...