ubuntu22.04环境中安装pylint

ubuntu22.04环境中安装pylint

  • [sudo apt-get install python3-pip](#sudo apt-get install python3-pip)
  • [sudo aptitude install python3-pip](#sudo aptitude install python3-pip)
  • [sudo pip install pylint](#sudo pip install pylint)

sudo apt-get install python3-pip

在安装pylint的时候,需要使用pip命令,在ubuntu22.04环境中命令如下:

$ sudo apt-get install python3-pip        
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-setuptools : Depends: python3-pkg-resources (= 59.6.0-1.2) but 59.6.0-1.2ubuntu0.22.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

这里提示报错导致安装不能继续,尝试了很多方法去解决这个问题,其实这个问题可以方便地通过aptitude命令来进行解决。

sudo aptitude install python3-pip

$ sudo aptitude install python3-pip
The following NEW packages will be installed:
  python3-pip{b} python3-wheel{a} 
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,337 kB of archives. After unpacking 7,176 kB will be used.
The following packages have unmet dependencies:
 python3-pip : Depends: python3-setuptools but it is not installable
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     python3-pip [Not Installed]                        



Accept this solution? [Y/n/q/?] n

注意这里一定要选择n,接着系统就会给出降版本的建议

The following actions will resolve these dependencies:

     Install the following packages:                                                
1)     python3-setuptools [59.6.0-1.2 (jammy)]                                      

     Downgrade the following packages:                                              
2)     python3-pkg-resources [59.6.0-1.2ubuntu0.22.04.1 (now) -> 59.6.0-1.2 (jammy)]


Accept this solution? [Y/n/q/?] Y

这里要选择Y,接着就可以正常安装。安装完毕使用whereis pip命令检查也符合预期。

sudo pip install pylint

使用命令sudo pip install pylint进行安装,确认安装状态(不同时期版本号会有所差异)。

$ pylint --version
pylint 3.1.0
astroid 3.1.0
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
相关推荐
Algorithm157610 分钟前
云原生相关的 Go 语言工程师技术路线(含博客网址导航)
开发语言·云原生·golang
岑梓铭10 分钟前
(CentOs系统虚拟机)Standalone模式下安装部署“基于Python编写”的Spark框架
linux·python·spark·centos
努力学习的小廉10 分钟前
深入了解Linux —— make和makefile自动化构建工具
linux·服务器·自动化
MZWeiei14 分钟前
Zookeeper基本命令解析
大数据·linux·运维·服务器·zookeeper
shinelord明19 分钟前
【再谈设计模式】享元模式~对象共享的优化妙手
开发语言·数据结构·算法·设计模式·软件工程
游客52024 分钟前
opencv中的各种滤波器简介
图像处理·人工智能·python·opencv·计算机视觉
Monly2126 分钟前
Java(若依):修改Tomcat的版本
java·开发语言·tomcat
boligongzhu26 分钟前
DALSA工业相机SDK二次开发(图像采集及保存)C#版
开发语言·c#·dalsa
Eric.Lee202127 分钟前
moviepy将图片序列制作成视频并加载字幕 - python 实现
开发语言·python·音视频·moviepy·字幕视频合成·图像制作为视频
7yewh29 分钟前
嵌入式Linux QT+OpenCV基于人脸识别的考勤系统 项目
linux·开发语言·arm开发·驱动开发·qt·opencv·嵌入式linux