Install wxPython in osx 10.11

前端 未结 7 1077
我在风中等你
我在风中等你 2021-02-06 05:39

When I try to install wxPython, it shows an error:

> The Installer could not install the software because there was no
> software found to in         


        
7条回答
  •  半阙折子戏
    2021-02-06 06:03

    Here are steps I successfully used to install wxPython 'Classic' (not 'Phoenix').
    OSX 10.11 or newer can not run that installer you tried, but this method will work.

    1. Pull these two newest sources into two sibling directories:
      https://github.com/wxWidgets/wxPython.git
      https://github.com/wxWidgets/wxWidgets.git
      (sources from before 12/16/2015 won't work for this method)
    2. Change directories cd /pathToYourGitHubSources/wxPython and run the following command:
      python build-wxpython.py --build_dir=../bld --osx_cocoa --install
    3. Build and install takes a while. After it is completed, you can try import wx, but may first need the following steps.
    4. Look in the newly created installed_files.txt to see what directories wxPython* files are in, as well as the location of /wx/*.py and /lib/*.pyc files. The three directories are probably like:
      /usr/lib/python2.7/site-packages
      /usr/lib/python2.7/site-packages/wx
      /usr/lib/python2.7/site-packages/wx/lib
    5. From terminal command line set environment and test wx:

      export PYTHONPATH='/usr/lib/python2.7/site-packages/wx'
      export DYLD_LIBRARY_PATH='/usr/lib/python2.7/site-packages/wx/lib'
      
      python
      
      import sys
      import wxversion
      try:
          wxversion.select(['3.0.3'])
      except wxversion.VersionError:
          print "wx version failed detection"
          sys.path.insert(0, '/usr/lib/python2.7/site-packages')
      
      import wx
      print wx.version()
      

    If the wx version printed, it's working.
    Some systems have other versions of wxPython or vestiges of old wxPythons installed that have led me to need setting the environment as seen above until the old pieces are cleaned off the system.

提交回复
热议问题