Install wxPython 4.2.2. on Ubuntu

Using Circle CI and trying to build 4.2.2;

pip install -v -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython

If I look in that directory I do not see the 4.2.2 files

Additionally, what ever the above is pulling from that directory and attempting to build, it times out after about 27 minutes

Never mind; Debugged this by firing up a Parallels Ubuntu VM;

Yes, there are not currently any Linux extras wheels built for 4.2.2. It’s on my to-do list to get to eventually.

As far as your error goes, we’d need to see the entire build log to try to figure out what went wrong.

Agreed, that is why I manually debugged it and looked at the requirements; Once I got them installed, even though the build runs for about 27 minutes on both CircleCI and TravisCI it eventually completes.

I provided the TravisCI build log link where build wxPython fails. It is big. I see the error:

Asking python-config for pyext '--cflags --libs --ldflags' flags : not found
  The configuration failed

Do you have the Python development package(s) installed for the Python version you’re using?

The only place I know where these are documented is here:

I don’t know how up to date that list is.

Am I looking at the correct one?

Are you using the python that was shipped with Ubuntu? In that case, you need to install the python3-dev package. If you’re using a different Python, you’ll have to make sure you have the development stuff installed.

Yes, I am running in a Travis CI environment.

I was getting this error:

Asking python-config for pyext ‘–cflags --libs --ldflags’ flags : not found
The configuration failed

After reading this:

I added the following lines to my .travis.yml

And the build completes (albeit, after 30 minutes)

GLOBAL=python --version
echo $GLOBAL
PY_VERSION=${GLOBAL#* }
pyenv global ${PY_VERSION}

I really wish we had pre-build Ubuntu images that could quickly be installed; Maybe if not too hard I could help

Oh - you are using pyenv. That would have been useful to know.

1 Like

Wheels have been built for wxPython 4.2.2 for Ubuntu (20.04, 22.04, and 24.04).

1 Like

Thanks, these work on TravisCI and my local VM running Python 3.12.7 under linux:

Linux ubuntu-linux-2404 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 22:03:50 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

However, when I import wx.App in my unit tests I get the following error

 from wx import App
  File "/home/hasii/PyCharmProjects/ogl/venv/lib/python3.12/site-packages/wx/__init__.py", line 12, in <module>
    __version__ = wx.__version__.VERSION_STRING
                  ^^^^^^^^^^^^^^
AttributeError: partially initialized module 'wx' has no attribute '__version__' (most likely due to a circular import)

Does the same thing happen with the previous wheel (4.2.1)?

Is there anything unique about this unit test environment?

The only unique thing is that this is on a Linux VM; on the VM, I am using pyenv to manage python versions; The same unit tests work on my Mac OS X 15.1, Mac book pro M1; This did not occur on 4.2.1

I had a similar issue but with pygeocoder. I just the VERSION = somenumber and all worked.
This was on windows 11 python 3.12.6 wxpython 4.2.2

Johnf

Hmm. Is that an environment variable or a variable in some module?

It’s a module that provides geo stuff. Don’t really use any longer but it’s not doing any harm.

Johnf