Ubuntu 22.04 and wxPython

Has anyone installed wxPython 4.x on Ubuntu 22.04 LTS. I don’t see any install tutorials. BTW Ubuntu 22.04 installs python 3.10.
Johnf

I installed from last sources :
https://wxpython.org/Phoenix/snapshot-builds/

following the recipe :
https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html

It works then as expected :slight_smile:

Thanks.
I wonder if you built a wheel? - that you can share.
Johnf

I don’t know where to share the build :
how should I proceed ?

If you don’t need wxPython 4.1.x, can you install 4.0.7 from the official
Ubuntu repositories. The package name is python3-wxgtk4.0.

if you have github account or something else?

github can’t accept files bigger than 25 Mo, and the wheel file is about 135 Mo.
I code on my spare time, so I’m not used to work with professional tools so far…
Another idea than github ?

I can use share point or maybe dropbox? What are your thoughts.

Here is a temporary link :
https://file.io/EBJGeYM07p5Q

It is online for 2 weeks, I let you put this file online permanently elsewhere for the community.

Thanks and I downloaded it. I’ll look into helping others with the file.
Johnf

Last time i installed it using this line

sudo pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython

And now I need to install it again, on fresh Mint 20.3 (what did you mean with 22.43, there’s no such beast?.. or if you really have it, where did you get it?) and the line obviously needs to be updated, but… how?

edit: the same line still works, it’s getting the whPython-4.1.1…whl

Not sure what you are making reference too when you say 22.43?
But I was using Ubuntu 22.04 LTS. I haven’t been able to test the whl provided because my hardware has not been stable.
Turn out to be the video driver - at least that has been working.
The Ubuntu 22.04 uses python 3.10 and that requires a different version - wxPython 4.1.2a (at least for the moment). That is my understanding at the moment.

Sorry, the .43 was a typo.
But yes, I got it working, all of it, using the same tricks. Stuck with python 3.8, for now.

Any more updates on install/building wxPython 4.2 on Ubuntu 22.04

I keep getting this:

 Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-_6o4gtn8/wxPython/setup.py", line 27, in <module>
        from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
      File "/tmp/pip-install-_6o4gtn8/wxPython/buildtools/config.py", line 30, in <module>
        from attrdict import AttrDict
      File "/home/travis/virtualenv/python3.10.5/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
        from attrdict.mapping import AttrMap
      File "/home/travis/virtualenv/python3.10.5/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>
        from collections import Mapping
    ImportError: cannot import name 'Mapping' from 'collections' (/opt/python/3.10.5/lib/python3.10/collections/__init__.py)

attrdict seems to be an archived project these days:

You need attrdict3 not attrdict.

1 Like

Hello,
I face the same issue, installing attrdict3 was not the solution, so I need to compile from sources:

https://wxpython.org/Phoenix/snapshot-builds/

after installing all the dependencies and compiling wxPython works fine.
But why we need to do all of these? Windows is a 5 minutes installation…
Using: Ubuntu 22.04 uptodate.

Because there aren’t any wheels for Linux, so it has to be compiled from scratch.