wxPython import error

后端 未结 10 1079
Happy的楠姐
Happy的楠姐 2021-02-05 17:56

I\'m having trouble figuring out an error message in Python.

yesterday, I\'ve installed python using the latest EPD package, and wxPython2.9 using the wxPython2.9-osx-co

相关标签:
10条回答
  • 2021-02-05 18:33

    this link helped me https://support.enthought.com/entries/22601196-wxPython-2-8-and-2-9

    Here's how I fixed the problem, which I hope will be useful for others in future

    1. In Terminal: gedit Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc

    2. Edit the line "backend : WXAgg" into "backend : QtAgg"

    3. Save and exit

    0 讨论(0)
  • 2021-02-05 18:33

    I've solved this on Windows by looking in the site packages folder in the python library. In there, there should be another folder titled site-packages. In this subfolder, there is the wxversion library. If you copy this library into the Lib folder in python, this import error should be averted.

    0 讨论(0)
  • 2021-02-05 18:38

    I've solved with this:

    defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
    
    0 讨论(0)
  • 2021-02-05 18:40

    Select your wx version before importing any wx modules

    import wxversion
    wxversion.select('2.8')

    The above code should come before import wx

    0 讨论(0)
  • 2021-02-05 18:40
    sudo apt-get install python-wxtools
    

    Install it. Worked for me.

    0 讨论(0)
  • 2021-02-05 18:42

    I solved this by setting the backend to MacOSX in ~/.matplotlib/matplotlibrc:

    backend : MacOSX

    0 讨论(0)
提交回复
热议问题