How to install wxPython correctly?

So, I was looking for different things to do in Python, for example, code for blinking text or a timer, but when I copied them into my window, there were constant syntax errors. Now, maybe you are not going to copy them directly, but one error I received is "there is no module named wx". I found out that I can get this module by installing wxPython. The problem is that I tried all 4 options, and none of them worked for me. Which one do I download and how to configure it using Windows?

thanks

+6
python windows download wxpython
source share
6 answers

According to the home page :

Make sure you have at least version 6.0.8 from pip and 12.0.5 for setuptools.

Install the Linux requirements specified in the readme.rst file at:

https://github.com/wxWidgets/Phoenix/blob/master/README.rst 

Install wxPython-Phoenix (Linux):

  sudo pip install --upgrade --trusted-host wxpython.org --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix 

Install wxPython-Phoenix (Windows, use the appropriate script folder):

  C:\python27\scripts\pip.exe install --upgrade --trusted-host wxpython.org --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix 
+5
source share

3 steps to install wx widgets and pygame in Python IDLE

  1. Install Python 3xxx on your system by selecting (add 3xxx to your path).
  2. Open the Python CLI to see if Python works or not.
  3. then open the command prompt (CMD).
    • enter PIP to see if pip is installed or not.
  4. enter the command: pip install wheel
  5. enter the command: pip install pygame
  6. To install wxpython, enter the command: pip install -U wxPython

It's all !!

+4
source share

This is on PyPI. Starting with wxPython 4, Python 3 is supported.

Unfortunately, PyPI has a package called wx which is stuck in version 3.0.3; Be sure to install the package named wxpython .

 pip install wxpython 

Please note that pip will automatically create wxWidgets for you, but will not install wxWidgets system dependencies such as GTK and OpenGLu. If the above command fails, look above for a message like this:

 checking for <something>... not found checking for <something>... no configure: error: <prereq> libraries not available Error running configure ERROR: failed building widgets 

This should give you information about at least one of the packages that are not on your system.

The "official" list of prerequisites from wxWidgets source :

  • Dpkg-dev
  • build interchangeable
  • libjpeg-dev
  • Libtiff-dev
  • libsdl1.2-dev
  • libgstreamer-plugins-base0.10-dev # or 1.0 if available
  • libnotify-dev
  • freeglut3
  • freeglut3-dev
  • libsm-dev
  • libgtk-3-dev
  • libwebkitgtk-3.0-dev # or libwebkit2gtk-4.0-dev, if available
  • libxtst-dev

The actual package names provided by your package manager may not match them, and frankly, I don’t know what is the best way to query the package manager to determine which packages provide the necessary libraries.

+2
source share

To properly install the wxPython graphics library, go to the next page ( https://wxpython.org/Phoenix/snapshot-builds/ ), which contains assemblies of snapshots of the wxPython library (version of Phoenix) depending on your OS and the version of Python that you want to work.

Then, when you downloaded the correct package for your system and python version, just install it using pip. In my case, I selected this (wxPython_Phoenix-3.0.3.dev2811 + ecc4797-cp36-cp36m-win_amd64.whl):

 pip install wxPython_Phoenix-3.0.3.dev2811+ecc4797-cp36-cp36m-win_amd64.whl 

To verify that it has been successfully installed in the site-packages folder for your current python environment, write:

 pip freeze 

Everything!

+1
source share

You need to make sure that the versions of your wxPython download match the installed python language library.

Current wxPython download downloads do not show libraries created against python 3. I believe in the python 3 porting project that is still ongoing.

If you are not sure what you are doing, I would stick with the 32-bit version on windows, as there are several Python libraries (i.e. IIRC, MySQLdb) that do not work with 64-bit python.

So then you will need to download python2.7 for Windows x86 and "wxPython3.0-win32-py27 32-bit Python 2.7"

0
source share

Check the version of wxpython and the python version installed on your computer. For python 2.7 use wxPython3.0-win32-3.0.2.0-py27 package

0
source share

All Articles