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实现支持目录FTP上传下载文件的方法
Jun 03 Python
浅析Python中的getattr(),setattr(),delattr(),hasattr()
Jun 14 Python
python使用Matplotlib绘制分段函数
Sep 25 Python
对numpy中向量式三目运算符详解
Oct 31 Python
pyqt5对用qt designer设计的窗体实现弹出子窗口的示例
Jun 19 Python
如何给Python代码进行加密
Jan 10 Python
python zip,lambda,map函数代码实例
Apr 04 Python
Django 设置admin后台表和App(应用)为中文名的操作方法
May 10 Python
Python 如何操作 SQLite 数据库
Aug 17 Python
Python3+Flask安装使用教程详解
Feb 16 Python
FP-growth算法发现频繁项集——发现频繁项集
Jun 24 Python
Python使用Beautiful Soup(BS4)库解析HTML和XML
Jun 05 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
PHP文本操作类
2006/11/25 PHP
10个实用的PHP代码片段
2011/09/02 PHP
采用PHP函数memory_get_usage获取PHP内存清耗量的方法
2011/12/06 PHP
php中用date函数获取当前时间有误的解决办法
2013/08/02 PHP
php实现aes加密类分享
2014/02/16 PHP
php curl登陆qq后获取用户信息时证书错误
2015/02/03 PHP
ThinkPHP使用getlist方法实现数据搜索功能示例
2017/05/08 PHP
快速解决PHP调用Word组件DCOM权限的问题
2017/12/27 PHP
JQuery 遮罩层实现(mask)实现代码
2010/01/09 Javascript
html中table数据排序的js代码
2011/08/09 Javascript
jQuery中append()方法用法实例
2014/12/25 Javascript
JavaScript实现页面5秒后自动跳转的方法
2015/04/16 Javascript
JavaScript中实现map功能代码分享
2015/06/11 Javascript
jQuery实现按钮只点击一次后就取消点击事件绑定的方法
2015/06/26 Javascript
常见的javascript跨域通信方法
2015/12/31 Javascript
简单易懂的天气插件(代码分享)
2017/02/04 Javascript
整理关于Bootstrap导航的慕课笔记
2017/03/29 Javascript
webpack项目调试以及独立打包配置文件的方法
2018/02/28 Javascript
Angular5.0 子组件通过service传递值给父组件的方法
2018/07/13 Javascript
CKEditor 4.4.1 添加代码高亮显示插件功能教程【使用官方推荐Code Snippet插件】
2019/06/14 Javascript
对layui初始化列表的CheckBox属性详解
2019/09/13 Javascript
Vue 实现可视化拖拽页面编辑器
2021/02/01 Vue.js
[03:48]大碗DOTA
2019/07/25 DOTA
python 将数据保存为excel的xls格式(实例讲解)
2018/05/03 Python
python实现二维数组的对角线遍历
2019/03/02 Python
Pycharm 2020.1 版配置优化的详细教程
2020/08/07 Python
CSS3实现菜单悬停效果
2020/11/17 HTML / CSS
巴西最大的家具及装饰用品店:Mobly
2017/10/11 全球购物
大学生毕业自我鉴定
2013/11/06 职场文书
优秀研究生自我鉴定
2013/12/04 职场文书
六十岁生日答谢词
2014/01/10 职场文书
卫生安全检查制度
2014/02/04 职场文书
物控部经理职务说明书
2014/02/25 职场文书
检讨书模板大全
2015/05/07 职场文书
仓库管理制度范本
2015/08/04 职场文书
《鲁滨逊漂流记》之六读后感(4篇)
2019/09/29 职场文书