Python Forum
[WxPython] Linux: No module named 'wx'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[WxPython] Linux: No module named 'wx'
#11
you need to install the items Joe_momma suggested in this post: https://python-forum.io/Thread-WxPython-...#pid108947 for some reason, certain ubuntu distros don't include as part of the default. I went through this with Linux Mint.
Reply
#12
I removed "libgstreamer-plugins-base0.10-dev" (apt complains about it) from the above-mentioned command. So I entered in the shell:
Quote:sudo apt-get install dpkg-dev build-essential libjpeg-dev libtiff-dev libsdl1.2-dev libnotify-dev freeglut3 freeglut3-dev libwebkitgtk-dev libghc-gtk3-dev libwxgtk3.0-gtk3-dev
Then I entered:
Quote:pip install wxpython
That command took very long. Nearly 1 hour.

Still no module named wx.

Greetings
Peter
Reply
#13
did the install run through without errors?
run pip list
also pip -V
and python -V
make sure all are in sync
Reply
#14
Yes "pip install ..." and "sudo apt install ..." did run without errors.

pip list
made this output:
https://pastebin.com/19TXD3uU

pip -V:
Output:
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
python -V:
Output:
Python 2.7.17
pip3 -V:
Output:
pip 19.2.3 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
python3 -V:
Output:
Python 3.8.2

But
Quote:sudo apt install libgstreamer-plugins-base0.10-dev

gives this error:
Error:
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libgstreamer-plugins-base0.10-dev E: Couldn't find any package by glob 'libgstreamer-plugins-base0.10-dev' E: Couldn't find any package by regex 'libgstreamer-plugins-base0.10-dev'

And please don't forget my problem is with Python3, not Python2.

OK I tried something on my own:
Quote:pip3 list

and the output was:
Output:
Package Version ---------- ------- pip 19.2.3 setuptools 41.2.0 WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Reply
#15
Quote:pip install wxpython
pip install wxpython will install for python 2.7
pip3 install wxpython will install for python 3x it's a common mistake-
looks like it's installed-
open a terminal start python 2.7 by entering python and check if you can import wxpython
if it is then install it for python3
here's a list of dependencies you will have to search for the proper ones for your distro:
Quote:python-dev (for your version of python)
gtk (preferably version 3, but depends on your needs)
gstreamer
gstreamer-plugins-base
glut
libwebkitgtk (matching your gtk version)
libjpeg
libpng
libtiff
libsdl
libnotify
libsm
to bypass that Buran's way of downloading the wheel and installing should have everything but you need the right wheel for your distro
try
apt-get install python-wxgtk2.8
Reply
#16
I tried all that but it still doesn't work. But wx works now for Python2. I'll try that. And if that doesn't work, I'll try Fedora distro.

Thanks for the help. I set it as "Solved" now.

Peter
Reply
#17
why not simply install python 3.7 (better that using python2) and use the whl downloaded as I advised?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#18
Or 3.8.2
Reply
#19
(Apr-02-2020, 06:22 AM)Larz60+ Wrote: Or 3.8.2
He is already on 3.8.2 but as it seems unable to install wxpython from source. The per-compiled linux whl available on the site are targeted at up to 3.7
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#20
I tried:
Quote:sudo apt install python3.7
Then python3 (without ".7" at the end) is still 3.8.2
Next I tried:
Quote:sudo apt remove python3
Still 3.8.2
How do I get rid of 3.8.2 without doing something like "ln -s ..."?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] ModuleNotFoundError: No module named 'PyQt5' matklt 2 16,736 Jun-02-2020, 07:05 AM
Last Post: Knight18
  [Kivy] ModuleNotFoundError: No module named 'kivy' Exsul 7 30,329 Mar-30-2019, 12:58 AM
Last Post: Exsul
  "ModuleNotFoundError: No module named '_tkinter' in Python 3.8 Alfa 0 programmerc 1 6,363 Oct-21-2018, 06:32 PM
Last Post: Larz60+
  PyGtk3, No Module Named gi, on python3.5 on Windows harun2525 8 34,482 May-19-2017, 01:30 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020