Python Forum
[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)

Pages: 1 2 3


RE: Linux: No module named 'wx' - buran - Apr-02-2020

instead of using python 3, just use python 3.7

or look at https://python-forum.io/Thread-Part-1-Linux-Python-3-environment?pid=18603#pid18603 for using pyenv for version management


RE: Linux: No module named 'wx' - PeterLinux - Apr-02-2020

It all doesn't work. I tried it. It's a bottomless pit.

I will use Python2 and tryout Fedora as soon as I get my ordered DVD-Rs.

Thanks for the help and the patience.
I view this as solved.

Greetings
Peter


RE: Linux: No module named 'wx' - snippsat - Apr-02-2020

PeterLinux Wrote: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 ..."?
You most never do this,if it now have removed the default python 3.6 that comes per-installed Ubuntu 18.
It can mess dependencies that Linux use from this default version.

If have compile yourself to 3.7,then can set alias to that version in ~/.bashrc.
alias python3=/usr/local/bin/python3.7

Buran Wrote:or look at https://python-forum.io/Thread-Part-1-Linux-Python-3-environment?pid=18603#pid18603 for using pyenv for version management
That's link to my older setup for pyenv.
Here is the new Thread pyenv Simple Python Version Management
So here a demo setting up WxPython when using pyenv.
tom@tom:~$ python -V
Python 3.8.1

# Go Back to 3.7,easy with pyenv
tom@tom:~$ pyenv global 3.7.3
tom@tom:~$ python -V
Python 3.7.3

# Install the one dependency that pyenv need to run wxpython
sudo apt-get update
sudo apt-get install libpython3.7-dev

# Install WxPython
pip install https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/wxPython-4.0.2-cp37-cp37m-linux_x86_64.whl

# Test that it work
tom@tom:~$ python
Python 3.7.3 (default, Apr 17 2019, 11:23:54) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> 
>>> wx.__version__
'4.0.2'
>>> exit()



RE: Linux: No module named 'wx' - PeterLinux - Apr-02-2020

Thanks again to everybody. I view this as solved.

Peter