Python3.7 下安裝pyqt5

第一步:首先進入python安裝目錄下的 【scripts】.python

第二步:執行安裝pyqt5的命令:python37 -m pip install pyqt5shell

出現如下安裝過程表明安裝成功。app

 第三步:在豆瓣網上安裝pyqt5 ,在後面加上「-i https://pypi.douban.com/simple」表示使用豆瓣所提供的鏡像:工具

        命令:python37 -m pip install PyQt5 -i https://pypi.douban.com/simple開發工具

第四步: 安裝Qt5圖形設計工具:  (圖形界面開發工具qt designer、翻譯工具liguist等等的工具)ui

        命令:python37 -m pip install PyQt5-tools -i https://pypi.douban.com/simple翻譯

 

第五步:將pyqt5-tools添加到全局環境變量(Path)中,個人是:設計

        C:\python37\Lib\site-packages\pyqt5_tools3d

第六步:驗證Qt5 是否安裝成功,在pycharm 中編寫以下代碼:blog

  import sys
  from PyQt5 import QtWidgets
  app = QtWidgets.QApplication(sys.argv)
  widget = QtWidgets.QWidget()
  widget.resize(360, 360)
  widget.setWindowTitle("hello, pyqt5")
  widget.show()
  sys.exit(app.exec())

第七步:執行第六步出現如下窗體後,表明pyqt5安裝成功

 第八步:安裝pipenv 虛擬環境  python37 -m pip install pipenv

第九步:配置pipenv 虛擬環境  python37 -m pipenv --three

 第十步:虛擬環境激活   python37 -m pipenv shell

相關文章
相關標籤/搜索