Unable to use view_cube command due to issue with wx

1.4k views Asked by At

I am seeing following issue:

In [5]: img = open_image("2018-09-21_005.hdr")

In [6]: view_cube(img, bands=[29, 19, 9])

ModuleNotFoundError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spectral/graphics/hypercube.py in 69 try: ---> 70 import wx 71 from wx import glcanvas

ModuleNotFoundError: No module named 'wx'

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last) in ----> 1 view_cube(img, bands=[29, 19, 9])

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spectral/graphics/graphics.py in view_cube(data, *args, **kwargs) 176 to accept keyboard input. 177 ''' --> 178 from spectral.graphics.hypercube import HypercubeWindow 179 180 if not running_ipython():

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/spectral/graphics/hypercube.py in 71 from wx import glcanvas 72 except ImportError: ---> 73 raise ImportError("Required dependency wx.glcanvas not present") 74 75 DEFAULT_WIN_SIZE = (500, 500) # Default dimensions of image frame

ImportError: Required dependency wx.glcanvas not present

I used following command to install wx: "brew install wxpython"

1

There are 1 answers

0
Radhe Raman Tiwari On

The problem was related to installation of python package

Use following command to install by pip :

pip install wxpython

And Use following command to install by conda environment :

conda install wxpython