It is an environment maintenance for using PyQt5. You can install it your own way.
Windows8.1
① Install Anaconda for PYTHON 3.5 from the following site. DOWNLOAD ANACONDA
(2) Start Spyder of the installed Python IDE.
③ After opening Spyder, open the Console tab at the bottom right. Then select the Options button in the upper right corner and click Open command prompt.
③ On the console screen
pip install virtualenv
And execute. virtualenv will be installed.
④ Similarly on the console screen
virtualenv pyqt
cd pyqt/Scripts
activate
To execute. The virtual environment is now created.
Then install PyQt5.
pip install pyqt5
This completes the installation of PyQt5. Now let's see how to execute the code. Please replace the location of the file with the environment you want to prepare.
(1) Create a "study_pyqt5" folder in the C drive. Save the script file in this folder.
(2) When the folder is created, create a file called "first.py" in it. Open first.py in your favorite editor, copy and paste the code below and save.
first.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QApplication, QWidget
if __name__ == '__main__':
app = QApplication(sys.argv)
w = QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple')
w.show()
sys.exit(app.exec_())
③ On the Spyder console screen,
cd C:\study_pyqt5
python first.py
To execute. Then a screen like the image below will appear.
The program is now running! : laughing:
PyQt5 installation PyQt5 Tutorial
Next time will try First programs roughly.
Recommended Posts