ubuntu 安装pyqt5和卸载pyQt5的方法


Posted in Python onMarch 24, 2020

安装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_() )

到此这篇关于ubuntu 安装pyqt5和卸载pyQt5的方法的文章就介绍到这了,更多相关ubuntu 安装pyqt5和卸载pyQt5内容请搜索三水点靠木以前的文章或继续浏览下面的相关文章希望大家以后多多支持三水点靠木!

Python 相关文章推荐
Python生成随机密码
Mar 10 Python
Python中的探索性数据分析(功能式)
Dec 22 Python
彻底搞懂Python字符编码
Jan 23 Python
python 通过logging写入日志到文件和控制台的实例
Apr 28 Python
完美解决在oj中Python的循环输入问题
Jun 25 Python
对python字典元素的添加与修改方法详解
Jul 06 Python
Python第三方Window模块文件的几种安装方法
Nov 22 Python
Python基于Tkinter模块实现的弹球小游戏
Dec 27 Python
Django实现WebSSH操作物理机或虚拟机的方法
Nov 06 Python
window环境pip切换国内源(pip安装异常缓慢的问题)
Dec 31 Python
如何用python爬取微博热搜数据并保存
Feb 20 Python
Python基于Opencv识别两张相似图片
Apr 25 Python
Python socket连接中的粘包、精确传输问题实例分析
Mar 24 #Python
Pyqt5 关于流式布局和滚动条的综合使用示例代码
Mar 24 #Python
Python+Appium实现自动化测试的使用步骤
Mar 24 #Python
Python3标准库之dbm UNIX键-值数据库问题
Mar 24 #Python
python网络编程socket实现服务端、客户端操作详解
Mar 24 #Python
python实现批量修改文件名
Mar 23 #Python
Python3 filecmp模块测试比较文件原理解析
Mar 23 #Python
You might like
ZF等常用php框架中存在的问题
2008/01/10 PHP
PHP 关于访问控制的和运算符优先级介绍
2013/07/08 PHP
php文件上传类完整实例
2016/05/14 PHP
ThinkPHP实现简单登陆功能
2017/04/28 PHP
php面试中关于面向对象的相关问题
2019/02/13 PHP
JS定时器实例
2013/04/17 Javascript
IE下JS读取xml文件示例代码
2013/08/05 Javascript
js获取url参数值的两种方式
2013/09/10 Javascript
js判断上传文件的类型和大小示例代码
2013/10/18 Javascript
jsonp原理及使用
2013/10/28 Javascript
HTML5 实现的一个俄罗斯方块实例代码
2016/09/19 Javascript
Angular表单验证实例详解
2016/10/20 Javascript
详解Vue自定义过滤器的实现
2017/01/10 Javascript
详解vue-cli 接口代理配置
2017/12/13 Javascript
利用JavaScript的Map提升性能的方法详解
2019/08/14 Javascript
[58:35]OG vs EG 2019国际邀请赛淘汰赛 胜者组 BO3 第二场 8.22
2019/09/05 DOTA
Python Web框架Pylons中使用MongoDB的例子
2013/12/03 Python
Linux下Python获取IP地址的代码
2014/11/30 Python
Python中字典映射类型的学习教程
2015/08/20 Python
pandas每次多Sheet写入文件的方法
2018/12/10 Python
python使用正则筛选信用卡
2019/01/27 Python
Python函数中的可变长参数详解
2019/09/12 Python
.dcm格式文件软件读取及python处理详解
2020/01/16 Python
使用SQLAlchemy操作数据库表过程解析
2020/06/10 Python
CK加拿大官网:Calvin Klein加拿大
2020/03/14 全球购物
酒店总经理工作职责
2013/12/13 职场文书
活动志愿者自荐信
2014/01/27 职场文书
博士毕业生自我鉴定范文
2014/04/13 职场文书
房地产开发项目建议书
2014/05/16 职场文书
光棍节联谊晚会活动策划书
2014/10/10 职场文书
初三英语教学计划
2015/01/23 职场文书
2015年圣诞节寄语
2015/08/17 职场文书
2016年感恩节活动总结大全
2016/04/01 职场文书
拥有这5个特征人,“命”都不会太差
2019/08/16 职场文书
创业计划书之情侣餐厅
2019/09/29 职场文书
Python采集壁纸并实现炫轮播
2022/04/30 Python