转载请注明来源。https://www.cnblogs.com/sogeisetsu/。然后我的CSDNhttps://blog.csdn.net/suyues/article/details/103218417里也发表了这篇文章。

首先,diss一下阿里源

【原创】ubuntu18.04阿里源巨坑!安装pip3 Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be

然后,直接说处理结果

sudo apt install python3-pip,如果不成功,换源!换成中科大源或者原始的源

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

/etc/apt/sources.list

然后更新源sudo apt-get update,然后升级sudo apt-get upgrade

接下来执行sudo apt install python3-pip

当时报的什么错我记不清了,大概就是没这个命令,本地没有这个包之类的。基本上用上面的方法就能解决了,如果解决不了,那就卸载掉python,重新安装吧。

更新

事情是这样的,我在执行sudo apt install python3-pip时,遇到了这样的问题:

Reading state information... Done
The following packages were automatically installed and are no longer required:
accountsservice apport-symptoms command-not-found-data cpp-5 distro-info-data gdisk iso-codes libaccountsservice0 libaio1 libdumbnet1 libevent-core-2.0-5
libisl15 libmpfr4 libreadline6 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-core-5.7 python-apt-common
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dh-python dpkg-dev fakeroot g g -7 gcc gcc-7 gcc-7-base
libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcilkrts5
libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl libgcc-7-dev libgomp1 libisl19 libitm1 liblsan0 libmpc3 libmpfr6 libmpx2 libpython3-dev
libpython3.6-dev libquadmath0 libstdc -7-dev libtsan0 libubsan0 linux-libc-dev manpages-dev python3 python3-asn1crypto python3-cffi-backend
python3-crypto python3-cryptography python3-dbus python3-dev python3-distutils python3-gi python3-idna python3-keyring python3-keyrings.alt
python3-lib2to3 python3-pkg-resources python3-secretstorage python3-setuptools python3-six python3-wheel python3-xdg python3.6-dev
Suggested packages:
binutils-doc cpp-doc gcc-7-locales debian-keyring g -multilib g -7-multilib gcc-7-doc libstdc 6-7-dbg gcc-multilib autoconf automake libtool flex bison
gdb gcc-doc gcc-7-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg
libmpx2-dbg libquadmath0-dbg glibc-doc bzr libstdc -7-doc python3-doc python3-tk python3-venv python-crypto-doc python-cryptography-doc
python3-cryptography-vectors python-dbus-doc python3-dbus-dbg gnome-keyring libkf5wallet-bin gir1.2-gnomekeyring-1.0 python-secretstorage-doc
python-setuptools-doc
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success

注意这几句

The following packages were automatically installed and are no longer required:
accountsservice apport-symptoms command-not-found-data cpp-5 distro-info-data gdisk iso-codes libaccountsservice0 libaio1 libdumbnet1 libevent-core-2.0-5
libisl15 libmpfr4 libreadline6 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-core-5.7 python-apt-common
Use 'apt autoremove' to remove them.

意思是有几个包是自动安装的,不需要他们了,可以用Use apt autoremoveto remove them。

剩余的几句意思是然后还会安装一些其他的包,还有几个建议安装的包,还不能从某个地方获得相应的回答(大概就是这么个意思,我英语不好,翻译做不到信达雅)

我们大体了解了出了哪些错,其实就集中在两个方面,一个是Use apt autoremoveto remove them,另一个是E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success

解决办法是先执行apt autoremove

然后执行sudo rm -rf /etc/apt/apt.conf.d/20snapd.conf 这个解决方法来自wsl,Ubuntu,关于解决E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/,具体怎么个意思我也不是很明白。

然后执行apt install python3-pip就好了。

记一次wsl上的pip3安装失败问题 The following packages were automatically installed and are no longer required:的更多相关文章

  1. MySQL在windows上多次安装失败

    Mysql首次安装: 1.官网下载mysql安装包 2.安装选择自定义,custom 3.更换路径,然后按需求选择,选择标准就行 Mysql重复安装需要注意的问题: 1.程序和功能下,需要卸载MySQ ...

  2. mysql安装不上怎么办 mysql安装失败原因和解决方法

    困难1:MySQL 5.1 安装过程中报apply security setting错误 1.卸载MySQL. 2.删除目录 C:\Documents and Settings\All Users\A ...

  3. adb 安装失败

    打开Terminal终端:Ctrl + Alt + T 按顺序执行以下三条命令:                   sudo add-apt-repository ppa:nilarrimogard ...

  4. 记一次Ubuntu 16.04 server安装中的坑

    最近博主搞了一台迷你主机,又刚好有时间去折腾,所以我打算把这台机子打造成一台迷你服务器,用来跑跑爬虫.挂挂网站 介于我我这台机子的配置比较垃圾(intel J1900+4G+64G),跑起Window ...

  5. linux下依赖库的版本问题引起的安装失败:libssl-dev版本问题无法安装 :libssl-dev : 依赖: libssl1.0.0 (= 1.0.1-4ubuntu3) 但是 1.0.1-4ubuntu5.31 正要被安装

    依赖库版本问题引起的安装失败解决方法如下有两种: 1.是由于源需要更新,如下操作: libssl-dev : 依赖: libssl0.9.8 (= 0.9.8o-1ubuntu4) 但是 0.9.8o ...

  6. error: Microsoft Visual C++ 14.0 is required(line_profiler模块安装失败的解决办法)

    一.我的安装环境: 1.系统:win10,64位 2.python版本:python3.6.4 二.遇到的问题: 1.cmd黑屏终端下输入命令:pip install line_profiler(安装 ...

  7. python3 与 pip3 安装与使用

    1. yum -y install openssl* (pip依赖ssl环境) 2.编译安装python3 下载地址:https://www.python.org/ftp/python/ .tgz c ...

  8. Windows上Python3.5安装Scrapy(lxml) 以及与twisted有关错误的解决

    转载于:http://www.cnblogs.com/silverbullet11/p/4966608.html 常用网址: Python 3.5: https://www.python.org/do ...

  9. Windows上Python3.5安装Scrapy(lxml)

    常用网址: Python 3.5: https://www.python.org/downloads/ Wheel文件:http://www.lfd.uci.edu/~gohlke/pythonlib ...

随机推荐

  1. 原生js拖拽、jQuery拖拽、vue自定义指令拖拽

    原生js拖拽: <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  2. Spring security 知识笔记【入门】

    一.生成spring boot项目文件 二.pom文件如下 <?xml version="1.0" encoding="UTF-8"?> <p ...

  3. loj 6051 「雅礼集训 2017 Day11」PATH - 多项式 - 钩子公式

    题目传送门 传送门 设 $m = \sum_{i = 1}^{n} a_i$. 总方案数显然等于 $\frac{m!}{\prod_{i = 1}^{n} a_i!}$. 考虑这样一个网格图,第 $i ...

  4. Java软件生产监控工具Btrace的使用

    Btrace BTrace是sun公司推出的一款Java 动态.安全追踪(监控)工具,可以在不用重启的情况下监控系统运行情况,方便的获取程序运行时的数据信息,如方法参数.返回值.全局变量和堆栈信息等, ...

  5. EventBus原理解析

    前言 EventBus的核心思想是观察者模式 (生产/消费者编程模型) . SpringBoot+EventBus使用教程(一) SpringBoot+EventBus使用教程(二) 通过前面的文章我 ...

  6. PyQt5笔记之菜单栏

    目录 菜单栏 创建单层菜单 创建多层菜单 右键打开菜单 官方菜单实例 菜单常用方法 菜单栏 创建单层菜单 import sys from PyQt5.QtWidgets import QApplica ...

  7. HTML5网页上播放mp4失败的原因

    HTML5先网页直接打开mp4 如果打不开 先用格式工厂转化下格式 转成mp4 avc编码 就行了 ps:ae要先导出mp4 然后再用上面的方法 不要导出avi 不然转化成 avc也是播放不了

  8. java登录点击验证码图片切换验证码无效

    1.问题:我在写一个登录时需要添加一个验证码的功能,但是第一次可以生成验证码,但是点击的时候无法发起请求. 2.解决方案:在请求地址后面加一个时间戳,保证每次请求都不一样就可以了! window.on ...

  9. 关于wepy小程序图片显示问题

    如果图片资源在本地,用background-image 是无法找到本地资源的,只能通过image标签用src进行引入: 图片资源在服务器上,用背景图片和image进行引入,在安卓真机上测试是没有问题的 ...

  10. ReentrantLock使用示例

    /** * ReentrantLock是独占锁 * Lock锁的使用,把锁和要用锁同步的代码放在一起,这里就是放在Printer类中了 * 获取到锁后,最后要在finally代码块中手动释放锁 */ ...