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 相关文章推荐
web.py在模板中输出美元符号的方法
Aug 26 Python
举例讲解Python中字典的合并值相加与异或对比
Jun 04 Python
Python操作使用MySQL数据库的实例代码
May 25 Python
Python排序搜索基本算法之堆排序实例详解
Dec 08 Python
python微信好友数据分析详解
Nov 19 Python
使用memory_profiler监测python代码运行时内存消耗方法
Dec 03 Python
python多线程下信号处理程序示例
May 31 Python
Python实现元素等待代码实例
Nov 11 Python
python实现批量处理将图片粘贴到另一张图片上并保存
Dec 12 Python
浅谈python中频繁的print到底能浪费多长时间
Feb 21 Python
python图片剪裁代码(图片按四个点坐标剪裁)
Mar 10 Python
Python数据可视化实现多种图例代码详解
Jul 14 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面向对象全攻略 (十) final static const关键字的使用
2009/09/30 PHP
php文件系统处理方法小结
2016/05/23 PHP
php模仿qq空间或朋友圈发布动态、评论动态、回复评论、删除动态或评论的功能(中)
2017/06/11 PHP
PHP面向对象程序设计(OOP)之方法重写(override)操作示例
2018/12/21 PHP
js鼠标点击事件在各个浏览器中的写法及Event对象属性介绍
2013/01/24 Javascript
使用ImageMagick进行图片缩放、合成与裁剪(js+python)
2013/09/16 Javascript
ExtJS的拖拽效果示例
2013/12/09 Javascript
js获取光标位置和设置文本框光标位置示例代码
2014/01/09 Javascript
Jquery easyui开启行编辑模式增删改操作
2016/01/14 Javascript
AngularJS入门教程之AngularJS模型
2016/04/18 Javascript
Javascript之Number对象介绍
2016/06/07 Javascript
Javascript基础_简单比较undefined和null 值
2016/06/14 Javascript
Ionic2系列之使用DeepLinker实现指定页面URL
2016/11/21 Javascript
简单快速的实现js计算器功能
2017/08/17 Javascript
VUE页面中加载外部HTML的示例代码
2017/09/20 Javascript
浅谈jquery中ajax跨域提交的时候会有2次请求的问题
2017/11/10 jQuery
微信小程序日历/日期选择插件使用方法详解
2018/12/28 Javascript
基于Vue实现的多条件筛选功能的详解(类似京东和淘宝功能)
2019/05/07 Javascript
Vue页面切换和a链接的本质区别详解
2019/11/12 Javascript
python获取一组数据里最大值max函数用法实例
2015/05/26 Python
一份python入门应该看的学习资料
2018/04/11 Python
Python如何优雅删除字符列表空字符及None元素
2020/06/25 Python
CSS3实现圆角、阴影、透明效果并兼容各大浏览器
2014/08/08 HTML / CSS
Hotels.com英国:全球领先的酒店住宿提供商
2019/01/24 全球购物
为女性购买传统的印度服装和婚纱:Kalkifashion
2019/07/22 全球购物
Java程序开发中如何应用线程
2016/03/03 面试题
爱岗敬业演讲稿范文
2014/01/14 职场文书
周年庆典邀请函范文
2014/01/24 职场文书
创业计划书的写作技巧及要点
2014/01/31 职场文书
服务员岗位责任制
2014/02/11 职场文书
学习十八大报告感言
2014/02/28 职场文书
80后职场人的职业生涯规划
2014/03/08 职场文书
导师工作推荐信
2015/03/27 职场文书
教师考核鉴定意见
2015/06/05 职场文书
浅谈PostgreSQL表分区的三种方式
2021/06/29 PostgreSQL
Spring boot实现上传文件到本地服务器
2022/08/14 Java/Android