cd ~ mkdir -p dev/envs dev/src cd dev/envs
sudo apt-get install python3-dev
wget https://bootstrap.pypa.io/get-pip.py sudo python3 get-pip.py rm get-pip.py sudo pip install virtualenv
virtualenv --prompt="[pyqt5] " pyqt5 source pyqt5/bin/activate pip install -U pip setuptools
# x64- # http://www.qt.io/download-open-source/#section-2 wget http://download.qt-project.org/official_releases/online_installers/qt-opensource-linux-x64-online.run chmod u+x qt-opensource-linux-x64-online.run ./qt-opensource-linux-x64-online.run rm qt-opensource-linux-x64-online.run # x86- # http://www.qt.io/download-open-source/#section-2 # wget http://download.qt-project.org/official_releases/online_installers/qt-opensource-linux-x86-online.run # chmod u+x qt-opensource-linux-x86-online.run # ./qt-opensource-linux-x86-online.run # rm qt-opensource-linux-x86-online.run
# http://www.riverbankcomputing.com/software/sip/download wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.5/sip-4.16.5.tar.gz tar xvzf sip-4.16.5.tar.gz cd sip-4.16.5/ python configure.py -d ~/dev/envs/pyqt5/lib/python3.4/site-packages/ make sudo make install sudo make clean cd .. rm -rf sip*
wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.4/PyQt-gpl-5.4.tar.gz tar xvzf PyQt-gpl-5.4.tar.gz cd PyQt-gpl-5.4/ # x64-, . # x86, ~/Qt/5.4/gcc_64/bin/qmake . # , , python configure.py --destdir ~/dev/envs/pyqt5/lib/python3.4/site-packages/ --qmake ~/Qt/5.4/gcc_64/bin/qmake make sudo make install sudo make clean cd .. rm -rf PyQt*
python -c "from PyQt5.QtCore import QT_VERSION_STR;from PyQt5.Qt import PYQT_VERSION_STR;from sip import SIP_VERSION_STR;print('Qt version: ',QT_VERSION_STR);print('SIP version: ',SIP_VERSION_STR);print('PyQt version: ',PYQT_VERSION_STR)"
Qt version: 5.4.0 SIP version: 4.16.5 PyQt version: 5.4
cd ../src/ mkdir pyqt_test cd pyqt_test/
# x64-. # x86 gcc_64 . ~/Qt/5.4/gcc_64/bin/designer
pyuic5 test.ui > test_ui.py
""" . """ # from datetime import datetime # from test_ui import Ui_Form # , class MainWindowSlots(Ui_Form): # def set_time(self): # '::' str_time = datetime.now().strftime('%H:%M:%S') # self.pushButton.setText(str_time) return None
""" . , . """ # import sys # from PyQt5.QtWidgets import QApplication, QWidget # from test_slots import MainWindowSlots # , class MainWindow(MainWindowSlots): # def __init__(self, form): # Ui_Form self.setupUi(form) # self.connect_slots() # def connect_slots(self): self.pushButton.clicked.connect(self.set_time) return None if __name__ == '__main__': # app = QApplication(sys.argv) # , UI window = QWidget() # UI ui = MainWindow(window) # window.show() # "" sys.exit(app.exec_())
python main.py
cd ../../envs/pyqt/ pip install -d . cx_freeze tar xvfz cx_Freeze-4.3.4.tar.gz
subl cx_Freeze-4.3.4/setup.py
cd cx_Freeze-4.3.4 python setup.py install rm ../cx_Freeze-4.3.4.tar.gz cd ../../../src/pyqt_test cxfreeze main.py --target-dir=nix_build
deactivate exit
cd dev sudo add-apt-repository ppa:ubuntu-wine/ppa sudo apt-get update sudo apt-get install wine1.7
# https://www.python.org/downloads/windows/ wget https://www.python.org/ftp/python/3.4.2/python-3.4.2.msi wine msiexec /i python-3.4.2.msi rm python-3.4.2.msi # http://www.riverbankcomputing.com/software/pyqt/download5 wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.4/PyQt5-5.4-gpl-Py3.4-Qt5.4.0-x32.exe wine PyQt5-5.4-gpl-Py3.4-Qt5.4.0-x32.exe rm PyQt5-5.4-gpl-Py3.4-Qt5.4.0-x32.exe # http://sourceforge.net/projects/cx-freeze/files/ wget http://downloads.sourceforge.net/project/cx-freeze/4.3.3/cx_Freeze-4.3.3.win32-py3.4.msi wine msiexec /i cx_Freeze-4.3.3.win32-py3.4.msi rm cx_Freeze-4.3.3.win32-py3.4.msi
http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze
wine cx_Freeze-4.3.4.win32-py3.4.exe rm cx_Freeze-4.3.4.win32-py3.4.exe
cd src/pyqt_test wine cmd cxfreeze main.py --target-dir=win_build
Source: https://habr.com/ru/post/248189/