JackMcKew / pyinstaller-action-windows

Github Action for building executables with Pyinstaller
MIT License
173 stars 71 forks source link

Unable to install wxpython before building #4

Closed guysoft closed 3 years ago

guysoft commented 3 years ago

Hey, I can't seem to build a wxpython dependent build because I get:

  File "backupfriend-client.py", line 1, in <module>
ModuleNotFoundError: No module named 'wx'

From the exe that is built. It works fine on my local machine.

I also added this to the actions, it builds and installs wxpython, but I still get the error above:

- run: sudo apt-get update && sudo apt install -y python3-pip python3-setuptools build-essential make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev && sudo pip3 install PyInstaller && pip3 install wxpython

yaml:

name: Package Application with Pyinstaller

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: wget-rdiff-backup
      uses: wei/wget@v1
      with:
        args: -O rdiff-backup-2.0.5.win32exe.zip https://github.com/rdiff-backup/rdiff-backup/releases/download/v2.0.5/rdiff-backup-2.0.5.win32exe.zip

    - name: Decompress
      uses: TonyBogdanov/zip@1.0
      with:
        args: unzip ./rdiff-backup-2.0.5.win32exe.zip -d .

    - name: Copy rdiff-backup to place
      run: |
        cp ./rdiff-backup-2.0.5/rdiff-backup.exe ./src/rdiff-backup.exe

    - run: sudo apt-get update && sudo apt install -y python3-pip python3-setuptools build-essential make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev && sudo pip3 install PyInstaller && pip3 install wxpython

    - name: Package Application
      uses: JackMcKew/pyinstaller-action-windows@main
      with:
        path: src

    - uses: actions/upload-artifact@v2
      with:
        name: backupfriend-client-win64
        path: src/dist/windows

Is there a way to pip-install this in advance before I run pyinstaller? That might fix the issue.

JackMcKew commented 3 years ago

Hey there!

I've set up a complete working example repository over at: https://github.com/JackMcKew/pyinstaller-action-windows-example

You should be able to have a requirements.txt within the root folder of the path (src in your case) you specify which will install any dependencies. Hopefully this helps.

guysoft commented 3 years ago

Adding a copy requirements to src in the build actions solves the issue

JackMcKew commented 3 years ago

Fantastic to hear 😊