Attempting to build on Linux - no module named 'wx'

82 views
Skip to first unread message

Kim Wall

unread,
Nov 14, 2022, 11:38:29 AM11/14/22
to CrossMgrSoftware
Hi,

I'm attempting to get a working build environment (preferably on Linux)
set up so that I might tinker...


I've followed the build instructions on GitHub, and it successfully
creates .Appimage files in the /release directory. Unfortunately, when
you attempt to run them, they die with: "ModuleNotFoundError: No module
named 'wx'"

This is in spite of the python3-wxgtk4.0 packages being installed.

Thinking this might be some Python version issue with my Debian 11
desktop, I've tried again on a clean install of Ubuntu 22.04 in a VM,
and end up with the same problem.

What am I doing wrong? I'm a C/Java programmer but know very little
about Python. I thought the whole point in pyinstaller/AppImage was
that it should avoid dependency hell with the host system, so is this a
problem with the build process? I note the instructions say that Python
3.8 and newer is not supported, yet the compile.sh script defaults to
3.10, so is this out of date?


Also, should I be able to run the programs directly from the build
directory somehow? eg "python Crossmgr.pyw" (that dies with "No module
named 'requests'")


Kim.
--
OpenPGP_signature

Edward Sitarski

unread,
Nov 14, 2022, 12:01:00 PM11/14/22
to crossmgr...@googlegroups.com
.Appimage has nothing to do with a development environment.
Rather, it is a pyinstaller executable that doesn't support development. 

You are going to have to invest in learning something about python development ;)
CrossMgr isn't a simple application, and wxPython adds some complexity as it is a binary extension.

Briefly, to get a working dev environment for CrossMgr:
  • Open a command window.
  • Download (or git pull) the CrossMgr project from github.
  • "cd" to the CrossMgr folder created on your local machine.
  • Do "python -mvenv env".  This will create a local python environment called "env".
  • Do './env/bin/activate" to activate the local environment (his command is different on Windows).  This configures python to only look for modules in the local environment.
  • If on Linux, install wxPython with pip (ignore this if on Mac or Windows).
    See here for instructions.  Follow the instructions at the bottom of the web page for Linux. It's a long command you have to enter.  It isn't a cut-and-paste as you have to change the version you need to install.  Look in this folder and use the install version you need for your Linux distro.
  • Now, install the rest of the python module dependencies with "pip install -r requirements.txt". On Linux you have to install wxPython manually first.  For other platforms, it will install automatically.
  • Enter "python MainWin.py".  CrossMgr should run.



--
You received this message because you are subscribed to the Google Groups "CrossMgrSoftware" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crossmgrsoftwa...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/crossmgrsoftware/95f2ba68-3c83-352f-8fd7-c9f89f8a7a0d%40ductilebiscuit.net.


--

Edward Sitarski

Chris Clague

unread,
Nov 14, 2022, 12:23:54 PM11/14/22
to CrossMgrSoftware
Oh I remember this pain. Shout if you need more help - I have CrossMgr running in docker on ubuntu 20.04. Planning on waiting until end of season before upgrading to 22.04.

Kim Wall

unread,
Nov 14, 2022, 7:50:49 PM11/14/22
to crossmgr...@googlegroups.com
Thanks for that, I now have a working dev environment. And with a few
hours of poking around (and surprisingly little cargo-cult Python)
appear to have managed to implement one of the simpler features I've
been contemplating.


Looks like the AppImage failing to run is a known issue:
<https://github.com/esitarski/CrossMgr/issues/77>


Kim.

On 14/11/2022 17:00, Edward Sitarski wrote:
> .Appimage has nothing to do with a development environment.
> Rather, it is a pyinstaller
> <https://pyinstaller.org/en/stable/> executable that doesn't support
> development.
>
> You are going to have to invest in learning something about python
> development ;)
> CrossMgr isn't a simple application, and wxPython adds some complexity
> as it is a binary extension.
>
> Briefly, to get a working dev environment for CrossMgr:
>
> * Open a command window.
> * Download (or git pull) the CrossMgr
> <https://github.com/esitarski/CrossMgr> project from github.
> * "cd" to the CrossMgr folder created on your local machine.
> * Do "python -mvenv env".  This will create a local python environment
> called "env".
> * Do './env/bin/activate" to activate the local environment (his
> command is different on Windows).  This configures python to only
> look for modules in the local environment.
> * If on Linux, install wxPython with pip (ignore this if on Mac or
> Windows).
> See here
> <https://wiki.wxpython.org/How%20to%20install%20wxPython#:~:text=the%20address%20wxPython-,GNU%2FLinux%20%2D%20Debian,call%20this%20with%20root%20permissions.> for instructions.  Follow the instructions at the bottom of the web page for Linux. It's a long command you have to enter.  It isn't a cut-and-paste as you have to change the version you need to install.  Look in this folder <https://extras.wxpython.org/wxPython4/extras/linux/gtk3/> and use the install version you need for your Linux distro.
> * Now, install the rest of the python module dependencies with "pip
> install -r requirements.txt". On Linux you have to install wxPython
> manually first.  For other platforms, it will install automatically.
> * Enter "python MainWin.py".  CrossMgr should run.
> <mailto:crossmgrsoftware%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/crossmgrsoftware/95f2ba68-3c83-352f-8fd7-c9f89f8a7a0d%40ductilebiscuit.net <https://groups.google.com/d/msgid/crossmgrsoftware/95f2ba68-3c83-352f-8fd7-c9f89f8a7a0d%40ductilebiscuit.net>.
>
>
>
> --
>
> Edward Sitarski
>
> --
> You received this message because you are subscribed to the Google
> Groups "CrossMgrSoftware" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to crossmgrsoftwa...@googlegroups.com
> <mailto:crossmgrsoftwa...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/crossmgrsoftware/CAAuZUpgZ8V%2B7VfL0jXi0-VvCAo7mydc-HASwk-ZKPbzL0k1HBA%40mail.gmail.com <https://groups.google.com/d/msgid/crossmgrsoftware/CAAuZUpgZ8V%2B7VfL0jXi0-VvCAo7mydc-HASwk-ZKPbzL0k1HBA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages