The official instructions for installing wxPython say
Windows and macOS
pip install -U wxPython
If you are on Windows or macOS with a compatible Python build, then the command shown above will download the appropriate wheel file from the latest release, and install it in your active Python environment or virtual environment.
As the wording hints to, this command only installs wxPython
for your default python version. (In this case, that seems to be Python 2.)
Just like the command python
is an alias for either python2
or python3
, the command pip
is an alias for either pip2
or pip3
. If you want to make sure that you install a module for both versions of Python, you should run both commands:
pip2 install -U wxPython
pip3 install -U wxPython
However, this solution is not recommended because it doesn't work with all python versions. Instead, it is recommended to use python -m pip
with your preferred version of python:
python2 -m pip install -U wxPython
python3 -m pip install -U wxPython
See also: Dealing with multiple python versions and PIP?