This is Fedora with python3-wxpython4-4.0.6-8 installed.
I tried a sample from the wxpython website:
#!/usr/bin/env python3
# First things, first. Import the wxPython package.
import wx
# Next, create an application object.
app = wx.App()
# Then a frame.
frm = wx.Frame(None, title="Hello World")
# Show it.
frm.Show()
# Start the event loop.
app.MainLoop()
and got
ImportError: bad magic number in 'wx': b'\x03\xf3\r\n'
If I understand this correctly it means that the Fedora package is in error. As I don’t want to mess around with the package in /usr/lib64/python3.7/site-packages/wx/ I cannot use wxPython for now.
Hopefully, the Fedora package gets fixed soon. Perhaps I find out where I could report a bug regarding the Fedora package.
1 -
Did you try to clean up your system with deleting the wx directories in :
/usr/local/lib64/python3.7/site-packages
Before installing the wxPython-4.0.6-cp37-cp37m-linux_x86_64.whl ?
2 -
Can you try the command :
sudo pip3 install wxPython-4.0.6-cp37-cp37m-linux_x86_64.whl
?
I don’t have (and didn’t have) anything in /usr/local/lib64/python3.7/site-packages. I also checked /usr/lib64/python3.7/site-packages/wx which didn’t exist.
I tried your suggestion no 2. and it was installed into /usr/local/lib64/python3.7/site-packages:
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Processing ./wxPython-4.0.6-cp37-cp37m-linux_x86_64.whl
Requirement already satisfied: numpy in /usr/lib64/python3.7/site-packages (from wxPython==4.0.6) (1.17.2)
Requirement already satisfied: six in /usr/lib/python3.7/site-packages (from wxPython==4.0.6) (1.12.0)
Requirement already satisfied: pillow in /usr/lib64/python3.7/site-packages (from wxPython==4.0.6) (6.1.0)
Installing collected packages: wxPython
Successfully installed wxPython-4.0.6
But nevertheless, the bad magic number errror persists
[aaa@localhost ~]$ python3
Python 3.7.3 (default, May 11 2019, 00:38:04)
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> print (wx.__version__)
4.0.6