ubuntu 安装pyqt5和卸载pyQt5的方法
作者:主攻 发布时间:2021-08-25 07:18:41
标签:ubuntu,安装,卸载,pyqt5
安装pyqt5
wind@wind-ThinkPad-X250:~/Downloads/PyQt5_gpl-5.12.2$ python3 -m pip install PyQt5
Collecting PyQt5
Downloading https://files.pythonhosted.org/packages/6a/f4/6a63aafcee3efd2b156dc835d9c85ca99b24e80f8af89b6da5c46054fe43/PyQt5-5.12.2-5.12.3-cp35.cp36.cp37.cp38-abi3-manylinux1_x86_64.whl (61.5MB)
100% |████████████████████████████████| 61.5MB 18kB/s
Collecting PyQt5_sip<13,>=4.19.14 (from PyQt5)
Downloading https://files.pythonhosted.org/packages/08/19/ef6b97cfdbb8f9312d71388384f572706e40bf88f07fffb0fc64846b4a36/PyQt5_sip-4.19.17-cp35-cp35m-manylinux1_x86_64.whl (67kB)
100% |████████████████████████████████| 71kB 107kB/s
Installing collected packages: PyQt5-sip, PyQt5
Successfully installed PyQt5-5.12.2 PyQt5-sip-4.19.17
You are using pip version 8.1.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
wind@wind-ThinkPad-X250:~/Downloads/PyQt5_gpl-5.12.2$
查看python 所有的安装包
>>> import sys
>>> sys.modules.keys()
dict_keys(['problem_report', '_bz2', 'email.feedparser', 'email.mime', 'base64', 'select', 'tarfile', '__future__', '_compat_pickle', 'importlib.util', 'mpl_toolkits', 'json.scanner', 'signal', 'json', 're', 'subprocess', 'ipaddress', 'configparser', '_functools', 'bz2', 'uu', 'pyexpat', 'copyreg', '__main__', 'selectors', 'apt.package', 'PyQt5', 'xml', 'pyexpat.errors', '_json', '_thread', 'email.message', 'apt.cdrom', 'calendar', 'importlib.abc', 'textwrap', 'random', 'email.mime.text', 'email._encoded_words', 'email._parseaddr', 'shutil', 'atexit', 'sre_parse', '_frozen_importlib_external', 'importlib.machinery', '_compression', 'zlib', 'copy', 'fcntl', '_weakref', 'sitecustomize', 'collections.abc', 'apport_python_hook', 'email.header', 'email.errors', '_io', '_operator', 'email.encoders', '_string', 'contextlib', '_frozen_importlib', '_pickle', 'apt.cache', 'token', '_signal', '_collections_abc', 'email._policybase', 'apt.progress', 'encodings.utf_8', 'genericpath', '_hashlib', 'heapq', '_socket', '_stat', 'site', 'sysconfig', 'xml.dom.minicompat', 'socket', '_struct', 'string', 'email.charset', 'importlib', 'pyexpat.model', 'gzip', 'codecs', '_warnings', 'apport.packaging_impl', 'threading', 'encodings', 'builtins', 'enum', 'binascii', 'http', 'itertools', 'operator', '_ssl', 'xml.parsers.expat', '_datetime', 'glob', '_locale', '_random', 'apport.fileutils', 'xml.dom.NodeFilter', '_posixsubprocess', 'abc', 'urllib.error', 'datetime', 'sre_constants', 'json.encoder', 'encodings.aliases', 'reprlib', '_weakrefset', 'json.decoder', 'importlib._bootstrap_external', 'sre_compile', 'email.mime.base', 'email.parser', 'math', 'keyword', 'encodings.latin_1', 'linecache', '_heapq', 'urllib', 'apport', 'tokenize', 'importlib._bootstrap', 'urllib.response', 'xml.parsers.expat.errors', 'apport.report', 'apport.packaging', 'posixpath', 'gettext', 'xml.dom.xmlbuilder', 'xml.dom', 'pwd', 'os', '_sysconfigdata_m', '_sitebuiltins', 'errno', 'xml.parsers.expat.model', 'os.path', '_sysconfigdata', '_sre', 'email.mime.multipart', 'collections', 'apt.progress.base', 'traceback', 'apt', 'io', 'weakref', 'urllib.request', 'hashlib', 'email.iterators', 'quopri', 'http.client', 'zipimport', '_imp', 'sys', 'rlcompleter', '_bootlocale', 'locale', 'urllib.parse', 'fnmatch', 'tempfile', 'xml.dom.domreg', '_codecs', 'bisect', 'email.utils', 'email.mime.nonmultipart', '_bisect', 'stat', 'warnings', 'ssl', 'functools', 'email', 'grp', '_lzma', 'email.quoprimime', 'struct', 'apt.progress.text', 'time', 'xml.parsers', 'email.base64mime', 'apt_pkg', 'pickle', 'imp', 'types', 'xml.dom.minidom', 'lzma', 'marshal', '_collections', 'readline', 'posix'])
>>>
删除pyqt5安装包
wind@wind-ThinkPad-X250:~$ sudo python3 -m pip uninstall PyQt5
[sudo] password for wind:
WARNING: The directory '/home/wind/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling PyQt5-5.12.2:
Would remove:
/home/wind/.local/bin/pylupdate5
/home/wind/.local/bin/pyrcc5
/home/wind/.local/bin/pyuic5
/home/wind/.local/lib/python3.5/site-packages/PyQt5-5.12.2.dist-info/*
/home/wind/.local/lib/python3.5/site-packages/PyQt5/*
Would not remove (might be manually added):
/home/wind/.local/lib/python3.5/site-packages/PyQt5/sip.so
Proceed (y/n)? y
Successfully uninstalled PyQt5-5.12.2
wind@wind-ThinkPad-X250:~$
使用例子
#!/bin/env python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QApplication, QWidget #导入相应的包
if __name__ == '__main__':
app = QApplication(sys.argv) #创建QApplication对象是必须,管理整个>程序,参数可有可无,有的话可接收命令行参数
w = QWidget() #创建窗体对象,
w.resize( 250, 150 ) #设置窗体大小
w.move( 100, 300 ) #设置在屏幕上的显示位置
w.setWindowTitle( 'Simple' ) #设置窗口标题
w.show() #窗口显示
sys.exit( app.exec_() )
来源:https://blog.csdn.net/weixin_42528089/article/details/90579245


猜你喜欢
- 闭包与defer1.闭包闭包 : 一个函数与其相关的引用环境组合的一个实体,其实可以理解为面向对象中类中的属性与方法。如代码块中,函数fun
- 本文实例讲述了Python实现微信中找回好友、群聊用户撤回的消息功能。分享给大家供大家参考,具体如下:还在好奇好友撤回了什么消息吗?群里撤回
- 本文实例讲述了Python中map和列表推导效率比较。分享给大家供大家参考。具体分析如下:直接来测试代码吧:#!/usr/bin/env p
- 可视化单词统计词频统计中文分词项目架构新建一个文件,输入文件的内容,查询此文件中关键字的出现的次数,关键字出现的位置,将所有的文本按照中文分
- 小编使用python中的django框架来完成!1,首先用pycharm创建django项目并配置相关环境这里小编默认项目都会创建setti
- 一.基本数据类型整数:int字符串:str(注:\t等于一个tab键)布尔值: bool列表:list (元素的集合)列表用[]元祖:tup
- 几个方式(本文不作介绍),要将Session保存到SQL Server中,需要有以下几个步骤:1.首先要创建用于保存Session数据的数据
- 本文实例为大家分享了python统计序列中元素的具体代码,供大家参考,具体内容如下问题1: &
- 本文实例讲述了php函数连续调用的方法。分享给大家供大家参考。具体如下:<?php //返回$this,实现连续调用 class xi
- 前言字符串是 字符的序列 。字符串基本上就是一组单词。我几乎可以保证你在每个Python程序中都要用到字符串,所以请特别留心下面这部分的内容
- 当然,如果你的网站文章中有图片,那么请记得一定要打上自己的LOGO,而且这个LOGO不要固定在这些图片的某个角落里,一定要随机出现在图片的任
- 原文地址:30 Days of Mootools 1.2 Tutorials - Day 14 - Periodical and Intro
- 一、切换到Oracle用户su – oracle二、登录到sys用户sqlplus / as sysdba三、创建临时表空间//查询临时表空
- A.截取从字符串左边开始N个字符 Declare @S1 varchar(100) Select @S1='http://www.x
- 本文实例讲述了python通过colorama模块在控制台输出彩色文字的方法。分享给大家供大家参考。具体分析如下:colorama是一个py
- 通过urllib2、re模块抓种子思路1.用程序登录论坛(如果需要登录才能访问的版块)2.访问指定版块3.遍历帖子(先取指定页,再遍历页面所
- 如何显示数据库中的图片和超级链接?代码见下:<% set conn=server.creatobject(&quo
- 最近在处理语音检索相关的事。 其中用到语音识别,调用的是讯飞与百度的api,前者使用js是实现,后者用python3实现(因为自己使用pyt
- 一、写在前面说道程序员,你会想到什么呢?有人认为程序员象征着高薪,有人认为程序员都是死肥宅,还有人想到的则是996和 ICU。别人眼中的程序
- 1 分类图像滤波按图像域可分为两种类型:邻域滤波(Spatial Domain Filter),其本质是数字窗口上的数学运算。一般用于图像平