Opened 13 years ago
Closed 12 years ago
#1496 closed defect (fixed)
GRASS 7 nightly build: Python script commands not shown from GUI (missing Python collections module)
Reported by: | giohappy | Owned by: | martinl |
---|---|---|---|
Priority: | blocker | Milestone: | 7.0.0 |
Component: | wxGUI | Version: | unspecified |
Keywords: | python scripts | Cc: | martinl |
CPU: | Unspecified | Platform: | MSWindows 7 |
Description
I'm evaluating the python scripting system, and I've found that on my Windows 7 machine no windows are opened inside the GUI for whatevere script. E.g. v.report, v.db.join, etc. don't show up. The problem seems due to "collections" python module missing from the bundled python.
GRASS 7.0.svn> Traceback (most recent call last):
File "C:\Program Files\GRASS 7.0.SVN\etc\gui\wxpython\wxgui.py", line 547, in
menuform.GUI(parent = self).ParseCommand(cmd)
File "C:\Program Files\GRASS 7.0.SVN\etc\gui\wxpython\gui_modules\menuform.py"
, line 1903, in ParseCommand
blackList = _blackList)
File "C:\Program Files\GRASS 7.0.SVN\etc\python\grass\script\task.py", line 45
1, in parse_interface
tree = etree.fromstring(get_interface_description(name))
File "C:\Program Files\GRASS 7.0.SVN\etc\python\grass\script\task.py", line 43
8, in get_interface_description
"\n\nDetails: %(det)s") % { 'cmd': cmd, 'det' : decode(cmderr) }
grass.script.core.ScriptError: u'Unable to fetch interface description for command \'v.report\'. Details: Traceback (most recent call last):
File "C:
Program Files
GRASS 7.0.SVN
scripts
v.report.py", line 47, in <module>\r\nimport grass.script as grass\r\n File "C:
Program Files
GRASS 7.0.SVN
etc
python
grass
script
init.py", line 1, in <module> from core import * File "C:
Program Files
GRASS 7.0.SVN
etc
python
grass
script
core.py", line 31, in <module> import subprocess File "C:
Program Files
GRASS 7.0.SVN
Python25
lib
subprocess.py", line 376, in <module> import threading File "C:
Program Files
GRASS 7.0.SVN
Python25
lib
threading.py", line 13, in <module> from collections import deque ImportError: No module named collections
Attachments (1)
Change History (11)
comment:1 by , 13 years ago
Priority: | critical → blocker |
---|
comment:2 by , 13 years ago
Too bad... So it's something with the command invocation system, because from CLI the collections builtin module is correctly loade, and from sys.path I can see that no mangling happens between different python versions on my pc. Does it mean that the GUI (or whatelse for it) doesn't correctly set the right paths for the embedded Python? Does it simply call a python module with the default system Python interpreter?
follow-up: 4 comment:3 by , 13 years ago
Cc: | added |
---|---|
Keywords: | python scripts added |
Please try the attached patch or daily build (1). The source of problems is a mismatch of Python versions. You are launching Python scripts with Python version distributed within OSGeo4W framework. To get interface description the same script (module) is launched again source:grass/trunk/lib/python/task.py#L439 but with Python version defined by OS. The workaround applied in the patch
os.chdir(os.path.join(os.getenv('GISBASE'), 'scripts')) cmdout, cmderr = Popen([sys.executable, cmd, '--interface-description'], stdout = PIPE, stderr = PIPE).communicate()
(1) http://wingrass.fsv.cvut.cz/grass70/WinGRASS-7.0.SVN-r49498-1-Setup.exe
by , 13 years ago
Attachment: | python-windows.diff added |
---|
follow-up: 5 comment:4 by , 13 years ago
comment:5 by , 13 years ago
follow-up: 8 comment:7 by , 13 years ago
I've just installed WinGRASS-7.0.SVN-r49586-1-Setup.exe nightly build, which includes r49565 fix, but trying to run v.report causes the following crash:
Traceback (most recent call last): File "C:\Program Files\GRASS 7.0.SVN\etc\gui\wxpython\wxgui.py", line 531, in OnMenuCmd GUI(parent = self).ParseCommand(cmd) File "C:\Program Files\GRASS 7.0.SVN\etc\gui\wxpython\gui_core\forms.py", line 1967, in ParseCommand blackList = _blackList) File "c:/osgeo4w/usr/src/grass_trunk/dist.i686-pc- mingw32/etc/python/grass/script/task.py", line 465, in parse_interface File "c:\OSGeo4W\apps\Python25\lib\xml\etree\ElementTree.py", line 964, in XML return parser.close() File "c:\OSGeo4W\apps\Python25\lib\xml\etree\ElementTree.py", line 1254, in close self._parser.Parse("", 1) # end of data xml.parsers.expat . ExpatError : no element found: line 1, column 0
follow-up: 9 comment:8 by , 13 years ago
comment:9 by , 12 years ago
comment:10 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
No answer almost one year. This issue should be already fixed. Closing, please re-open if needed.
Known problem, unfortunately not solved yet. At least I have similar problem on my machine. See
You have probably more Python versions installed on your computer. When getting interface description
Popen
calls module again probably with different version of Python rather then byGRASS_PYTHON
.Martin