ubuntu 安装pyqt5和卸载pyQt5的方法

 更新时间:2020年03月24日 09:39:13   作者:主攻  
这篇文章主要介绍了ubuntu 安装pyqt5和卸载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_() )

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

相关文章

  • Python使用文件操作实现一个XX信息管理系统的示例

    Python使用文件操作实现一个XX信息管理系统的示例

    这篇文章主要介绍了Python使用文件操作实现一个XX信息管理系统的示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-07-07
  • Python 结构化字符串中提取数据详情

    Python 结构化字符串中提取数据详情

    这篇文章主要介绍了Python 结构化字符串中提取数据详情,文章围绕主题展开详细的内容介绍,具有一定的参考价值,需要的小伙伴可以参考一下
    2022-08-08
  • 用生成器来改写直接返回列表的函数方法

    用生成器来改写直接返回列表的函数方法

    下面小编就为大家带来一篇用生成器来改写直接返回列表的函数方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-05-05
  • Python与Appium实现手机APP自动化测试的示例代码

    Python与Appium实现手机APP自动化测试的示例代码

    本文主要介绍了Python与Appium实现手机APP自动化测试的示例代码,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-02-02
  • 用Python实现一个简单的多线程TCP服务器的教程

    用Python实现一个简单的多线程TCP服务器的教程

    这篇文章主要介绍了用Python实现一个简单的多线程TCP服务器的教程,示例的运行环境为Windows操作系统,需要的朋友可以参考下
    2015-05-05
  • Python命名空间与作用域深入全面详解

    Python命名空间与作用域深入全面详解

    命名空间是从名称到对象的映射,大部分的命名空间都是通过 Python 字典来实现的,作用域就是一个可以直接访问命名空间的正文区域。程序的变量并不是在哪个位置都可以访问的,访问权限决定于这个变量是在哪里赋值的
    2022-11-11
  • Python使用yaml模块操作YAML文档的方法

    Python使用yaml模块操作YAML文档的方法

    YAML是可读性高,用来表达数据序列化格式的,专用于写配置文件的语言,这篇文章主要介绍了Python使用yaml模块操作YAML文档,需要的朋友可以参考下
    2023-01-01
  • python绘图demo实现流程介绍

    python绘图demo实现流程介绍

    这篇文章主要介绍了python绘图demo实现流程,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习吧
    2022-11-11
  • Python统计python文件中代码,注释及空白对应的行数示例【测试可用】

    Python统计python文件中代码,注释及空白对应的行数示例【测试可用】

    这篇文章主要介绍了Python统计python文件中代码,注释及空白对应的行数,涉及Python针对py文件的读取、遍历、判断、统计等相关操作技巧,需要的朋友可以参考下
    2018-07-07
  • 如何使用python wasmtime调用rust生成的wasm库

    如何使用python wasmtime调用rust生成的wasm库

    这篇文章主要介绍了如何使用python wasmtime调用rust生成的wasm库,使用python wasmtime来访问rust库的便捷方法,步骤极其简练,可以在生产环境中使用,需要的朋友可以参考下
    2023-01-01

最新评论