今天在安装环境pip install xxx时遇到了这个问题

这个问题是因为python3.8之后就没有了linux_distribution这个性质

网上的解决方法好像主要是下载distro,import distro,然后将distro.linux_distribution()替换platform.linux_distribution()

但问题是我遇到的情况是根本无法pip install

采用的解决方法是升级pip3

首先查看pip3的版本和python3的版本

pip3 --versionpip 8.1.1 from /usr/local/lib/python3.8/dist-packages (python 3.8)
python3 --versionPython 3.8.10

可见pip的版本确实确实有点低

下载并安装新的pip3

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.8 get-pip.py

显示"Successfully installed pip-23.0.1"

同时也有warning:

"WARNING: The scripts pip, pip3 and pip3.8 are installed in '/home/liuyulin/.local/bin' which is not on PATH."

于是将路径添加到~/.bashrc中

echo 'export PATH=/home/liuyulin/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

再次查看pip3版本:

pip3 --versionpip 23.0.1 from /home/liuyulin/.local/lib/python3.8/site-packages/pip (python 3.8)

说明成功更新,再下载pip install xxx不报错

AttributeError: module ‘platform‘ has no attribute ‘linux_distribution‘相关推荐

  1. NVIDIA Jetson Xavier NX上导入tensorflow报错:AttributeError: module ‘wrapt‘ has no attribute ‘ObjectProxy‘

    欢迎大家关注笔者,你的关注是我持续更博的最大动力 原创文章,转载告知,盗版必究 在Jetson Xavier NX上导入tensorflow报错:AttributeError: module 'wra ...

  2. pyinstall :打包 .exe 文件报错AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘

    有疑问的地方 参考博文 一.环境搭建 Python GUI图形化小工具编程学习-- PySide2 环境搭建(一) 二.实例演示 Python GUI图形化小工具编程学习-- Demo 实例演示(二) ...

  3. 解决: AttributeError: module 'cv2' has no attribute 'SURF'

    AttributeError: module 'cv2' has no attribute 'SURF' 遇到该问题时,网友多是建议补个包,即pip install opencv-contrib-py ...

  4. AttributeError: module ‘seaborn‘ has no attribute ‘tsplot‘

    AttributeError: module 'seaborn' has no attribute 'tsplot' 问题: g = sns.tsplot(df['pm2.5']) plt.figur ...

  5. AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘错误解决

    AttributeError: module 'tensorflow' has no attribute 'Session'错误解决 根据网上教程安装tensorflow环境时,最后都会有个测试代码用 ...

  6. Python 报错解决:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

    早上升级完pip,后报错如下: -> # pip install --upgrade pwntools /usr/local/lib/python2.7/dist-packages/pip/_v ...

  7. AttributeError: module ‘sys‘ has no attribute ‘maxint‘

    AttributeError: module 'sys' has no attribute 'maxint' https://stackoverflow.com/questions/47027354/ ...

  8. AttributeError: module 'tensorflow' has no attribute 'random_normal'

    执行<TensorFlow实战Google深度学习框架(第2版)>only源代码 CH3 时如下语句报错 batch_size = 8 w1= tf.Variable(tf.random_ ...

  9. Python3 AttributeError: module 'cv2' has no attribute 'SIFT'

    参考 https://blog.csdn.net/yuxuan_08/article/details/87966840 在用python3使用sift = cv2.SIFT()进行SIFT时候,可能会 ...

最新文章

  1. 7、Spring -Cloud-路由网管Spring Cloud Zuul
  2. 说说标准服务器架构(WWW+Image/CSS/JS+File+DB)
  3. angular 的配置文件的应用
  4. Qt设置QWidget背景色4种方法
  5. 深入了解CSS字体度量,行高和vertical-align
  6. MobaXterm远程连接Linux图形用户界面
  7. 2019.08.27BOM的六个子对象(1)
  8. 项目案例模板之登录注册的实现
  9. Ubuntu 12.04忘记登录密码及修改密码
  10. cad怎样弄出放线的坐标_不知道如何定位放线?今天教大家一个快速准确放线方法(含实例)...
  11. android W F 密码,这几种Android图形密码最常用 你也在用吗?
  12. 数字化城管信息系统项目需求说明书
  13. Cloud Computing HCIA-③华为企业级虚拟化解决方案
  14. vs2017 项目开发 解决方案下的多个项目
  15. Django计算机毕业设计餐饮管理系统(程序+LW)Python
  16. minecraft编程java_第一章 minecraft编程mod
  17. OPENMV-STM32串口通信
  18. 务实的思维与学习–如何有意识地思考思维与学习
  19. 截取含有中文的字符段
  20. 从零开始一起学习SLAM-ICP原理及应用

热门文章

  1. 多行文字垂直居中实现--四种方法
  2. 宝讯网捷:拼多多免费流量怎么去做?
  3. 析构函数、虚析构函数、纯虚析构函数
  4. 成都大运会「数智竞技邀请赛」启动,「开悟」平台为全球青年提供AI竞技舞台...
  5. 学Python的人,做什么工作最赚钱?
  6. 2019.5.师徒会总结快键键,和学习工具
  7. 全球高效能人士给青年的50个忠告(中)--转载
  8. 张一鸣辞职半年后,成为中国互联网首富——“我奋斗的目标不是为了赚钱”
  9. Debian 搭建 WireGuard 服务端
  10. 5年经验之谈 —— 功能测试和性能测试的区别是什么?