How to properly install wxPython?

匿名 (未验证) 提交于 2019-12-03 02:59:02

问题:

So I was looking around at different things to do on Python, like code for flashing text or a timer, but when I copied them into my window, there were constant syntax errors. Now, maybe you're not meant to copy them straight in, but one error I got was 'no module named wx'. I learned that I could get that module by installing wxPython. Problem is, I've tried all 4 options and none of them have worked for me. Which one do I download and how do I set it up using Windows?

Thanks

回答1:

As per home page instruction:

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

Install requirements for Linux as outlined in the readme.rst 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  


回答2:

3 steps to install wx-widgets and pygame in python IDLE

  1. Install python 3xxx in your system opting (Add 3xxx to your path).
  2. open python CLI whether python is working or not.
  3. then open command prompt (CMD).
    • type PIP to see whether pip is installed or not.
  4. enter command : pip install wheel
  5. enter command : pip install pygame
  6. To install wxpython enter command : pip install -U wxPython

Thats all !!



回答3:

To install wxPython GUI library correctly go to the following page (https://wxpython.org/Phoenix/snapshot-builds/), which contains snapshots builds of wxPython library (Phoenix version) depending on your os and version of Python you want to work.

Then when you downloaded the proper package for your system and python version, simply install it by using pip. In my case I've choosen that one (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 check that it has been installed sucessfully on the site-packages folder for your current python environment write:

pip freeze 

It's all!



回答4:

It's on PyPI. As of wxPython 4, Python 3 is supported.

Unfortunately, PyPI has a package called wx that is stuck at version 3.0.3; be sure to install the package named wxpython instead.

pip install wxpython 


回答5:

You need to ensure the versions of your wxPython download matches your installed python language library.

The current downloads wxPython downloads doesn't show any libraries built against python 3. I Believe the python 3 porting project is still ongoing.

If you are not sure of what you are doing I would stick with the 32bit version on windows as there are some Python libraries (ie IIRC, MySQLdb) which don't work with 64 bit python.

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



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!