0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Python: Windows10+Eclipse+PyQt5で作成したGUIソフトをラズパイで動かす方法①

Posted at

記)2021/02/27

この記事はメモである。いずれちゃんとした記事にはする予定

①ラズパイ
pip3のアップグレード、これをしないとPyQt5インストール時にsetup.pyが見つからないとエラーが出てインストールできない(理由不明)
sudo pip3 install --upgrade pip

PyQT5インストール
sudo pip3 install PyQt5
めっちゃ呪い 数時間かかる

Windows側Eclipse
あらかじめ、GitHubにはプッシュ出来るようにしておきリポジトリは作っておく

フォルダ構成
例)
GUItest
--init.py
--main.py
setup.py
requirements.txt

init.py中身は空ファイル

main.py

import sys
from PyQt5.QtCore import pyqtSlot
from  PyQt5.QtWidgets import QApplication,QMainWindow

from pk1.ui_test import Ui_MainWindow


class GUItest(QMainWindow,Ui_MainWindow):
    def __init__(self, parent=None):
        super(GUItest,self).__init__(parent)
        self.setupUi(self)
        #loadUi('test.ui',self)
        #self.pushButton.clicked.connect(self.onPushButtonCliked)

    #@pyqtSlot()
    #def onPushButtonCliked(self):
    #   self.label1.setText(self.textEdit.text)
def main():
    app=QApplication(sys.argv)
    widget=GUItest()
    widget.show()
    sys.exit(app.exec_())

if __name__=="__main__":
    main()

setup.py

from glob import glob
from os.path import basename
from os.path import splitext

from setuptools import setup
from setuptools import find_packages


def _requires_from_file(filename):
    return open(filename).read().splitlines()


setup(
    name="GUItest",
    version="0.1.0",
    license="ライセンス",
    description="パッケージの説明",
    author="sureisu",
    url="https://github.com/kamoshika9999/PythonTest.git",
    packages=find_packages("GUItest/src"),
    package_dir={"": "GUItest/src"},
    py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
    include_package_data=True,
    zip_safe=False,
    install_requires=_requires_from_file('GUItest/requirements.txt'),
    setup_requires=["pytest-runner"],
    tests_require=["pytest", "pytest-cov"],
    entry_points={'console_scripts':['guitest = pk1.main:main' ]}
)

エクリプスからGitHubにプッシュすると
GUItestがルートとなってしまい、pip3でインストールするときにsetup.pyが見つからないとでる

GitHubのリポジトリルートにsetup.pyを手動で作成する。中身は同じ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?