[WxPython] Linux: No module named 'wx' - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: [WxPython] Linux: No module named 'wx' (/thread-25426.html) |
Linux: No module named 'wx' - PeterLinux - Mar-30-2020 When I run my little Python script in the shell, I get the following error: I use:Xubuntu Linux 18.04 Python 3.8.2 In /usr/lib/wx/python/ are these files: I already tried building Python from source (successfully/without errors) and installing with apt wx3.0-headers and wx-common. How can I get "import wx" working?Thanks in advance for any hint, greetings Peter I've boiled down the script to this: #!/usr/bin/python3 import wx(Now the error occurs in line 3, not 6.) RE: Linux: No module named 'wx' - Larz60+ - Mar-30-2020 pip install wxpython
RE: Linux: No module named 'wx' - PeterLinux - Mar-30-2020 Then it says: and finally:
RE: Linux: No module named 'wx' - PeterLinux - Mar-30-2020 Should I better ask in a Ubuntu or Gtk forum than here? Greetings Peter RE: Linux: No module named 'wx' - joe_momma - Mar-30-2020 Quote:No package 'gtk+-3.0' found Quote:*** Could not run GTK+ test program, checking why...looks like you have not installed the dependencies required to build wxpython $ sudo apt-get update $ sudo apt-get install dpkg-dev build-essential libjpeg-dev libtiff-dev libsdl1.2-dev libgstreamer-plugins-base0.10-dev libnotify-dev freeglut3 freeglut3-dev libwebkitgtk-dev libghc-gtk3-dev libwxgtk3.0-gtk3-dev RE: Linux: No module named 'wx' - buran - Mar-31-2020 did you try to download a wheel for linux from https://wxpython.org/pages/downloads/ and this is the direct link https://extras.wxpython.org/wxPython4/extras/linux/ RE: Linux: No module named 'wx' - PeterLinux - Mar-31-2020 @joe_momma: I get this error when I envoke the second shell command you mentioned: @buran: OK I downloaded the wheel. And what I'm going to do with it?Greetings Peter RE: Linux: No module named 'wx' - buran - Mar-31-2020 (Mar-31-2020, 10:56 AM)PeterLinux Wrote: And what I'm going to do with it?install it locally Just noticed you are on 3.8, and wheels are up to 3.7. Not sure if this may cause any problems
RE: Linux: No module named 'wx' - PeterLinux - Mar-31-2020 I typed: Quote:pip install wxPython-4.0.7.post2-cp37-cp37m-linux_x86_64.whlAnd got this error: Huh? I'm on a 64bit (x86_64) system and my python is 64 bit (I checked that).I've read in a thread with a similar problem that Python 3.8 isn't stable: https://python-forum.io/Thread-ModuleNotFoundError-No-module-named-tkinter-in-Python-3-8-Alfa-0 I use Python 3.8.2. Maybe that's the problem? RE: Linux: No module named 'wx' - buran - Mar-31-2020 (Mar-31-2020, 11:36 AM)PeterLinux Wrote: I've read in a thread with a similar problem that Python 3.8 isn't stable:The other thread refer to 3.9 which is unstable (not yet released). 3.8 is latest stable version. However, it looks like the problem is that wheel is for 3.7 and you are on 3.8. As I said, I didn't notice that initially and didn't check whl for what python version are available |