码迷,mamicode.com
首页 > 其他好文 > 详细

PyQt5的安装及使用(pycharm)

时间:2019-11-24 13:40:19      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:des   ase   rem   mat   div   eve   image   exe   you   

参考链接:https://www.cnblogs.com/pywjh/articles/9835931.html

        https://blog.csdn.net/SeekAndFindYou/article/details/81264684

1.安装pythom(略)

2.安装pycharm(略)

3.安装pyqt5

3.1首先是安装pyqt5

pip install PyQt5

出现错误:

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    PyQt5 from https://files.pythonhosted.org/packages/1f/0e/d0390f7ac55c3d4ac041cbdb13fa2b03225a7f8856d52f712e7e398b2208/PyQt5-5.13.2-5.13.2-cp35.cp36.cp37.cp38-none-win32.whl#sha256=14737bb4673868d15fa91dad79fe293d7a93d76c56d01b3757b350b8dcb32b2d:
        Expected sha256 14737bb4673868d15fa91dad79fe293d7a93d76c56d01b3757b350b8dcb32b2d
             Got        c2886891b8915741ee3103cec3156d5282b22e5766187151b139e2044cedb248

WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the python -m pip install --upgrade pip command.

 输入

python -m pip install --upgrade pip

再输入

pip install PyQt5

安装成功!

3.2 安装Qt工具

pip install PyQt5-tools

出现下面错误

ERROR: Could not find a version that satisfies the requirement PyQt5-tools (from versions: none)
ERROR: No matching distribution found for PyQt5-tools

解决方法如下:

https://pan.baidu.com/s/1GVhquhTe5bgrjGRvUVRloQ 提取码:ain0 
下载后得到一个.whl文件
将上面文件放在C:\Windows\SysWOW64\ 目录下

WIN+R输入cmd,回车打开命令提示符:
输入:pip install wheel
然后:pip install PyQt5_Tools-5.7.dev1-py3-none-any.whl
至此就成功安装了pyqt5-tools

安装完成之后先确认一下安装位置,因为之后用的上,正常的话,会在你的python的安装目录下的

\pythonx.x\Lib\site-packages目录下,如图:

技术图片

3.3 安装安装QtDesigner

然后进入pycharm的File下的settings->Tools->External Tools 点加号,

Name:QtDesigner  
Program:之前PyQt5-tools目录下的designer.exe文件 如我的E:\Python38\Lib\site-packages\PyQt5-tools\designer\designer.exe
Working directory:$FileDir$

3.4安装PyUIC

进入pycharm的File下的settings->Tools->External Tools 点加号,

Name:PyUIC  
Program:python目录下的Script下的pyuic5.exe的目录

Argument:
-m
PyQt5.uic.pyuic
$FileName$
-o
$FileNameWithoutExtension$.py

Working directory:$FileDir$

3.5安装PyRCC

进入pycharm的File下的settings->Tools->External Tools 点加号,

Name:PyRCC  
Program:python目录下的Script下的pyrcc5.exe的目录

Argument:
$FileName$
-o
$FileNameWithoutAllExtensions$.py

Working directory:$FileDir$

over,over,over!

 再次声明并致谢:本文参考

https://www.cnblogs.com/pywjh/articles/9835931.html

 https://blog.csdn.net/SeekAndFindYou/article/details/81264684

 

 

 

 

PyQt5的安装及使用(pycharm)

标签:des   ase   rem   mat   div   eve   image   exe   you   

原文地址:https://www.cnblogs.com/xdd1997/p/11921946.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!