error description:

  1. pip3 install numpy
  2. Traceback (most recent call last):
  3. File "/usr/bin/pip3", line 9, in <module>
  4. from pip import main
  5. ImportError: cannot import name 'main'

You must have inadvertently upgraded your system pip (probably through something like sudo pip install pip --upgrade)

pip 10.x adjusts where its internals are situated. The pip3 command you're seeing is one provided by your package maintainer (presumably debian based here?) and is not a file managed by pip.

You can read more about this on pip's issue tracker

You'll probably want to not upgrade your system pip and instead use a virtualenv.

To recover the pip3 binary you'll need to

  1. sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall

If you want to continue in "unsupported territory" (upgrading a system package outside of the system package manager), you can probably get away with python3 -m pip ... instead of pip3.

cannot import name 'main' 解决方案的更多相关文章

  1. pip---cannot import name main解决方案

    .先来看下Python不同版本对应的路径 which python3. which python3. .使用update-alternatives --install建立链接 sudo update- ...

  2. Import Error:cannot import name main解决方案

    在Ubuntu上安装软件,不小心升级了pip,导致使用时报错如下: Import Error:cannot import name main 后来发现是因为将pip更新为10.0.0后库里面的函数有所 ...

  3. pip3更新后install package出现ImportError: cannot import name 'main'

    linux下pip3更新后,install包出现main不能导入的情况: bear@bear:~/eclipse-workspace/Python-toolbox$ pip3 install pycr ...

  4. ImportError : cannot import name main

    当我们有时候安装不成功插件或者其他模块时候,会有pip报错hu@hu-VirtualBox:~/下载/MySQL-python-1.2.4b4$ pip install pymysqlTracebac ...

  5. pip install ImportError: cannot import name main

    在Ubuntu上用pip install装ansible时报错 root@user:~# pip install --no-cache-dir ansible -i http://mirrors.al ...

  6. 输入pip命令报错:from pip import main ImportError: cannot import name 'main'

    报错信息: qly@qlyComputer:~$ pip Traceback (most recent call last): File "/usr/bin/pip", line ...

  7. Ubuntu|ython3 :ImportError: cannot import name 'main'

    1.问题 root@stephen-K55VD:/usr/bin# pip3 Traceback (most recent call last): File "/usr/bin/pip3&q ...

  8. 修复服务器上出现ImportError: cannot import name main的问题

    在服务器上成功升级pip2之后再运行pip2命令出现如下报错信息 Traceback (most recent call last): File "/usr/bin/pip2.7" ...

  9. ubuntu升级pip后, ImportError: cannot import name ‘main‘

    场景描述: 原先pip安装完成之后,一直没有更新版本,原pip版本为8.1.1,今天安装python 包pysftp的时候,提示需要升级pip到(pip 10.0.1); 于是乎,直接手到擒来,终端命 ...

随机推荐

  1. spark优化之临时目录

    官方是这样说的: Directory to use for "scratch" space in Spark, including map output files and RDD ...

  2. ref:linux用户和组管理,/etc/passwd,/etc/shadow和/etc/group 文件内容解释

    ref:https://www.cnblogs.com/xuha0/p/5519232.html 与用户相关的系统配置文件主要有/etc/passwd 和/etc/shadow,其中/etc/shad ...

  3. jbox小型交互表单(ajax)

    function updateval(id){ var url = '${ctx}/zbapp/ranking/zbappRankingList/form?id=${zbappRankingList. ...

  4. 001.SSH配置文件

    一 ssh配置文件路径 1.1 ssh客户端配置文件: 路径:/etc/ssh/ssh_config 1.2 ssh服务端配置文件: 路径:/etc/ssh/sshd_config 二 服务器端常用配 ...

  5. grid网格系统布局

    grid布局: 基于网格的2维布局方法1:display: grid | inline-grid | subgrid作用:启用网格grid容器 grid:定义一个块级的网格容器 inline-grid ...

  6. View 的滑动

    View 的滑动 学习自 <Android开发艺术探索> 滑动漫谈 因为Android手机屏幕大小的原因,所以为了显式更多的信息,我们必须采用滚动的方式来处理,因为滚动就涉及到了滑动,有的 ...

  7. ArduinoYun教程之OpenWrt-Yun与CLI配置Arduino Yun

    ArduinoYun教程之OpenWrt-Yun与CLI配置Arduino Yun OpenWrt-Yun OpenWrt-Yun是基于OpenWrt的一个Linux发行版.有所耳闻的读者应该听说他是 ...

  8. handlebars.min.js的使用

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. HDU.5181.numbers(DP)

    题目链接 参考. \(Description\) 将\(1,2,\cdots,n(n\leq 300)\)依次入栈/出栈,并满足\(m(m\leq 90000)\)个形如\(x\)要在\(y\)之前出 ...

  10. hdu 1241Oil Deposits(dfs模板)

    题目链接—— http://acm.hdu.edu.cn/showproblem.php?pid=1241 首先给出一个n*m的字符矩阵,‘*’表示空地,‘@’表示油井.问在这个矩阵中有多少组油井区? ...