I’m trying to update my Python package to (finally) use Python 3+, coming from 2.7. I wasn’t the one who set up our environment originally, but by word of mouth I’ve heard we used the apt-get approach to install wxPython previously.
After not finding wxPython in the apt-get repositories, I figured I’d try the (personally, preferable) approach of using pip. I installed the prerequisites found HERE. I dealt with a RAM limitation (on a Raspberry Pi) by adding a swap. And, after a few hours or so, the installation finished. I didn’t think to turn on verbose printing, so I don’t have the whole log for it on hand, at least that I’m aware of.
The incantation was:
$ sudo pip3 install --upgrade --find-links Index of /wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython
The --find-links came from the main wxPython website HERE. We’re running Ubuntu MATE 16.04.
Here is info on the installation:
$ pip3 show wxPython
Name: wxPython
Version: 4.0.0b2
Summary: Cross platform GUI toolkit for Python, “Phoenix” version
Home-page: http://wxPython.org/
Author: Robin Dunn
Author-email: robin@alldunn.com
License: wxWindows Library License (The wxWindows Library Licence – Open Source Initiative)
Location: /usr/local/lib/python3.5/dist-packages
Requires: six
As mentioned, the previous wxPython installation was done using apt-get, so doing a “pip show” doesn’t give anything. However, doing a help(wx) after importing tells me the path to it is:
/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/__init__.py
However, now when I try to “import wx”, I get the following:
Python 3.5.2 (default, Sep 14 2017, 22:51:06)
[GCC 5.4.0 20160609] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import wx
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python3.5/dist-packages/wx/init.py”, line 17, in
from wx.core import *
File “/usr/local/lib/python3.5/dist-packages/wx/core.py”, line 12, in
from ._core import *
ImportError: /usr/local/lib/python3.5/dist-packages/wx/_core.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: _Py_ZeroStruct
Have I missed a step somewhere? Is it still trying to use something from the old installation, which is still around?