您的位置:首页 > 运维架构 > Linux

solution for GRASS GIS 6.4.3 on linux failed to open the gui

2015-04-07 17:24 585 查看
GRASS GIS 6.4.3 on linux have errors as follows:

GRASS 6.4.3 (nc_spm_08):~/softgrass/grass/bin > g.gui gui=wxpython

Launching 'wxpython' GUI in the background, please wait ...

Traceback (most recent call last):

File "/home/qq/softgrass/grass/grass-6.4.3/etc/wxpython/wxgui.py", line 34, in <module>

from lmgr.frame import GMFrame

File "/home/qq/softgrass/grass/grass-6.4.3/etc/wxpython/lmgr/frame.py", line 46, in <module>

from lmgr.layertree import LayerTree, LMIcons

File "/home/qq/softgrass/grass/grass-6.4.3/etc/wxpython/lmgr/layertree.py", line 37, in <module>

from mapdisp.frame import MapFrame

File "/home/qq/softgrass/grass/grass-6.4.3/etc/wxpython/mapdisp/frame.py", line 52, in <module>

from wxplot.profile import ProfileFrame

File "/home/qq/softgrass/grass/grass-6.4.3/etc/wxpython/wxplot/profile.py", line 23, in <module>

import wx.lib.plot as plot

File "/home/qq/softgrass/python/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/lib/plot.py", line 132, in <module>

raise ImportError, "Numeric,numarray or NumPy not found. \n" + msg

ImportError: Numeric,numarray or NumPy not found.

This module requires the Numeric/numarray or NumPy module,

which could not be imported. It probably is not installed

(it's not part of the standard Python distribution). See the

Numeric Python site (http://numpy.scipy.org) for information on

downloading source or binaries.

Solution:

When I checked in Python, I had numpy installed, so that wasn’t the issue.

I couldn’t find anything useful online to help me fix it but then I thought, it’s Python and it’s open source. Let’s have a hack!

I opened the following file (if I was more leet I would have used vim or nano or something):

/home/qq/softgrass/python/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/lib/plot.py

I then went to line 117 and added the first three linesshown in the code block below,
remembering to alter all the indents etc:

try:

import numpy as _Numeric

except:


try:

import numpy.oldnumeric as _Numeric

except:

try:

import numarray as _Numeric #if numarray is used it is renamed Numeric

except:

try:

import Numeric as _Numeric

except:

msg= """

This module requires the Numeric/numarray or NumPy module,

which could not be imported. It probably is not installed

(it's not part of the standard Python distribution). See the

Numeric Python site (http://numpy.scipy.org) for information on

downloading source or binaries."""

raise ImportError, "Numeric,numarray or NumPy not found. \n" + msg

I then saved the file and restarted GRASS and it all (seems) to be running smoothly and as it should do.

From: http://ajgdevelop.com/tag/linux/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐