[GRASS-user] [pid file issue for d.* ]

Ang Sherpa angsherpa232 at gmail.com
Tue Jan 10 20:38:29 PST 2017


This is what command shell throws:

Cleaning up temporary files...
Starting GRASS GIS...
WARNING: Concurrent mapset locking is not supported on Windows
Executing <d.mon wx2> ...
Execution of <d.mon wx2> finished.
Cleaning up temporary files...

C:\Users\WRPPF-A>ERROR: Variable 'LOCATION_NAME' not set
Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS 7.2.0/gui/wxpython/mapdisp/main.py",
line 608, in <module>
    fd = open(pidFile, 'w')
IOError: [Errno 2] No such file or directory: 'C:\\Users\\WRPPF-A\\
Documents\\grassdata\\nc_spm_08_grass7\\user1\\.tmp/
unknown/MONITORS/wx2\\pid'

What am I missing?

I have attached my script herewith this mail.

*Regards,*
*Ang Dawa Sherpa*
*GIS technician - Irrigation Master Plan*
*WRPPF - DOI, Nepal Government*
*Lalitpur*
*contact: 984 007 3861*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170111/47467b32/attachment-0001.html>
-------------- next part --------------
#!/usr/bin/env python
import os
import sys
import time
import subprocess

gisdbase = os.path.join(os.path.expanduser("~"), "Documents\\grassdata")
location = "nc_spm_08_grass7"
mapset   = "user1"
gisbase  = os.environ['GISBASE'] = r'C:\Program Files\GRASS GIS 7.2.0'
sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python"))

# Just in case system can't find where grass.script is
grass_install_tree = os.getenv('GISBASE')
sys.path.append(grass_install_tree + os.sep + 'etc' + os.sep + 'python')

##c:\users\WRPPF-A\Documents\grassdata\nc_spm_08_grass7\user1

import grass.script.setup as gsetup
import grass.script as gscript


#This throws PERMANENT mapset missing error
#subprocess.Popen(['cmd','/K','grass72 -text','d.mon start=wx1'],cwd=gisbase)

##time.sleep(2)

subprocess.Popen(['cmd','/K','grass72 -text','--exec','d.mon','wx2'],cwd=gisbase)
rcfile = gsetup.init(gisbase,gisdbase, location, mapset)

print "grass environment"
gscript.message('Current Grass GIS 7 enviornment:')
print gscript.gisenv()
##print '\n'
##print gtask.command_info('r.info')
print gscript.read_command('r.info',map = 'accum_5k')
##time.sleep(2)
time.sleep(2)
##gscript.run_command('d.mon','wx4')
##time.sleep(2)
##gscript.run_command('d.rast',map = 'accum_5k')

os.remove(rcfile)



More information about the grass-user mailing list