python安装wx模板,如何为Python安装wxversion

I'm experimenting with the "SPy" Spectral Python library, using PyCharm, and I've gotten to the point where it tells me that wxversion was not found. How can I install wxversion?

I'm very new to Python in general, so am I doing something else wrong? Here is my code:

import matplotlib

#matplotlib.use('WX') #Replaced by editing matplotlibrc

from spectral import *

img = open_image('92AV3C.lan')

print img.__class__

print

print img

print

print img.shape

pixel = img[50,100]

print

print pixel.shape

band6 = img[:,:,5]

print

print band6.shape

print

arr = img.load()

print arr.__class__

print

print arr.info()

print

print arr.shape

view = imshow(img, (29, 19, 9))

Here is the error:

Traceback (most recent call last):

File "/Users/pkillam/PycharmProjects/untitled/SPy Experiments", line 36, in

File "/Library/Python/2.7/site-packages/spectral/graphics/spypylab.py", line 1238, in imshow

import matplotlib.pyplot as plt

File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.py", line 98, in

_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()

File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backends/__init__.py", line 28, in pylab_setup

globals(),locals(),[backend_name],0)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backends/backend_wxagg.py", line 6, in

import backend_wx # already uses wxversion.ensureMinimal('2.8')

File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backends/backend_wx.py", line 53, in

raise ImportError(missingwxversion)

ImportError: Matplotlib backend_wx and backend_wxagg require wxversion, which was not found.

Also, are there any other guides/tutorials out there for SPy?

解决方案

You can install wxPython on Mac just by downloading it from www.wxpython.org. Please take note of the following notice on their website:

NOTE: This installer is not signed by Apple, so by default your Mac will tell you it is corrupted and will not install it. You can get around this by temporarily relaxing the security settings in System Preferences. In the Security & Privacy section set "Allow applications downloaded from" to "Anywhere."

I have followed their directions and had no problem installing wxPython on Mac (Yosemite) once I changed those settings.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值