it tells me that "" is not recognized as command intern.
I'm using the winGRASS 6.4. standalone version. I guess the problem is that the scripts are in shell language, compared to the .exe files of for example v.build.polylines.
So, does anybody know how to call a shell script with python under windows? Or do I have to include somehow the translated scripts of GRASS7?
I'm running the python script with eclipse.
I'm happy about any hints.
Sonja
Thanks, but the data type doesn't change that's a shell script. I still have the same error message: (sorry, it's in french, but it says as much as v.db.addcol is not a executable program or a bat file).
I tried as well os.system("v.db.addcol map=ditch columns='urban int'"), but it's the same.
Sonja
'""' n'est pas reconnu en tant que commande interne
ou externe, un programme ex‚cutable ou un fichier de commandes
I'm using the winGRASS 6.4. standalone version. I guess the problem is
that the scripts are in shell language, compared to the .exe files of
for example v.build.polylines.
In this case, it's a problem with the arguments to v.db.addcol, as
Martin has pointed out.
So, does anybody know how to call a shell script with python under
windows? Or do I have to include somehow the translated scripts of GRASS7?
The GRASS packages for Windows include a batch file for each shell
script. If you create your own shell scripts, you also need to create
a batch file.
On Windows, grass.run_command() etc invoke the program via cmd.exe, so
they also work with scripts, provided that the script has an extension
and the extension is associated with the correct interpreter.
The shell scripts don't have an extension, hence the need for the
batch files. In 7.0, the shell scripts have been replaced by Python
scripts, which have a .py extension, so the batch files aren't
required.
Thanks, but the data type doesn't change that's a shell script. I still
have the same error message: (sorry, it's in french, but it says as much
as v.db.addcol is not a executable program or a bat file).
I tried as well os.system("v.db.addcol map=ditch columns='urban int'"),
but it's the same.
This can occur if PATH is incorrect. GRASS' "bin" directory should be
in the path, the "scripts" directory shouldn't be. There should be a
batch file named v.db.addcol.bat in the "bin" directory.
I deleted all reference to the to the scripts directory in the PATH, but I still have the same problem:
'""' n'est pas reconnu en tant que commande interne ou externe, un programme ex‚cutable ou un fichier de commandes.
Now my environment variables are as follows:
GISBASE C:\GRASS-4-SVN
GISRC C:\Documents and Settings\jankowfsky\.grassrc6
LD_LIBRARY_PATH C:\GRASS-4-SVN\lib
PATH C:\GRASS-4-SVN\etc;C:\GRASS-4-SVN\etc\python;C:\GRASS-4-SVN\lib;C:\GRASS-4-SVN\bin;C:\GRASS-4-SVN\extralib;C:\Python26;
PYTHONLIB C:\Python26
PYTHONPATH C:\GRASS-4-SVN\etc;C:\GRASS-4-SVN\etc\python;C:\GRASS-4-SVN\lib;C:\GRASS-4-SVN\bin;C:\GRASS-4-SVN\extralib;C:\Python26;
I've checked and there is a v.db.addcol.bat file in the bin directory.
I get the same problem for v.db.renamecol. If I use the GRASS windows command line to call directly the GRASS function v.db.addcol it works fine.
Does anybody has another idea what could be the problem?
Thanks,
Sonja
Glynn Clements a écrit :
Sonja Jankowfsky wrote:
Thanks, but the data type doesn't change that's a shell script. I still have the same error message: (sorry, it's in french, but it says as much as v.db.addcol is not a executable program or a bat file).
I tried as well os.system("v.db.addcol map=ditch columns='urban int'"), but it's the same.
This can occur if PATH is incorrect. GRASS' "bin" directory should be
in the path, the "scripts" directory shouldn't be. There should be a
batch file named v.db.addcol.bat in the "bin" directory.
--
Sonja Jankowfsky
UR Hydrologie-Hydraulique
Cemagref de Lyon
3 bis quai Chauveau CP 220
69336 Lyon Cedex 09
FRANCE
Tel : (+33)4 72 20 86 11 Fax : (+33)4 78 47 78 75
in C:\Windows\system32\cmd.exe
C:\GRASS-4-SVN\bin\v.in.ogr.exe
result: L'ordinal 284 est introuvable dans la bibliothèque de liaisons dynamique SSLEAY32.dll.
(call to v.in.ogr works fine in a pythonscript run in Eclipse, but not run in the windows command line)
C:\GRASS-4-SVN\bin\v.db.addcol.bat
result: '""' n'est pas reconnu en tant que commande interne ou externe, un programme ex‚cutable ou un fichier de commandes.
in GRASS Command Line
GRASS 6.4.0svn (YzeronEPSG)> C:\GRASS-4-SVN\bin\v.in.ogr.exe opens the GUI
same for .... v.db.addcol.bat
I have no idea where the error with the SSLEAY32.dll comes from, but my conclusion for the v.db.addcol is, that:
inside GRASS there is something installed to execute the bat files with shell scripts. Do I have to add this "something" to my environment variables of my windows machine in order to be able to run the bat files with my windows command line? What's this "something", Msys?
Do I have to be inside GRASS to run the pythonscripts?
Thanks for any ideas,
Sonja
Glynn Clements a écrit :
Sonja Jankowfsky wrote:
Thanks, but the data type doesn't change that's a shell script. I still have the same error message: (sorry, it's in french, but it says as much as v.db.addcol is not a executable program or a bat file).
I tried as well os.system("v.db.addcol map=ditch columns='urban int'"), but it's the same.
This can occur if PATH is incorrect. GRASS' "bin" directory should be
in the path, the "scripts" directory shouldn't be. There should be a
batch file named v.db.addcol.bat in the "bin" directory.
--
Sonja Jankowfsky
UR Hydrologie-Hydraulique
Cemagref de Lyon
3 bis quai Chauveau CP 220
69336 Lyon Cedex 09
FRANCE
Tel : (+33)4 72 20 86 11 Fax : (+33)4 78 47 78 75
When starting GRASS via the grass64.bat file, GRASS_SH should end up
being set to "c:\msys\1.0\bin\sh.exe". I believe that the installers
override this setting to use a copy which is installed in the GRASS
directory.
in C:\Windows\system32\cmd.exe
C:\GRASS-4-SVN\bin\v.in.ogr.exe
result: L'ordinal 284 est introuvable dans la bibliothèque de liaisons
dynamique SSLEAY32.dll.
I think that's something like "the ordinal 284 could not be found in
the dynamic library SSLEAY32.dll". SSLeay is the original name of
OpenSSL, which is used by some of the libraries used by GDAL
(typically database libraries).
(call to v.in.ogr works fine in a pythonscript run in Eclipse, but not
run in the windows command line)
A missing ordinal suggests that it's finding the wrong version of the
library. This is likely to be related to the PATH setting, which
Windows uses to locate DLLs, as well as executables.
Many thanks for your tips!
Concerning the missing ordinal, I had a check and I only have 2 SSLEAY32.dll libraries on my machine:
The one in C:\GRASS-4-SVN\extralib, which is indicated in the PATH and one other in C:\OSGeo4w\bin, but that's not in the PATH. So windows should take the first one.
I think, the problem with the ordinal is coming from something else, but I don't know what.
Concerning the second problem I added GRASS_SH = C:\GRASS-4-SVN\msys\bin\sh.exe (I only have msys inside GRASS installed) to the environment variables.
Now, I get a different error message:
C:\GRASS-4-SVN/scripts/v.db.addcol: line 55: basename: command not found
C:\GRASS-4-SVN/scripts/v.db.addcol: line 63: basename: command not found
C:\GRASS-4-SVN/scripts/v.db.addcol: line 66: which: command not found
ERREUR :awk required, please install awk or gawk first
do I have to add other executable to the environment variables?
Glynn Clements a écrit :
Sonja Jankowfsky wrote:
in C:\Windows\system32\cmd.exe
C:\GRASS-4-SVN\bin\v.in.ogr.exe
result: L'ordinal 284 est introuvable dans la bibliothèque de liaisons dynamique SSLEAY32.dll.
I think that's something like "the ordinal 284 could not be found in
the dynamic library SSLEAY32.dll". SSLeay is the original name of
OpenSSL, which is used by some of the libraries used by GDAL
(typically database libraries).
(call to v.in.ogr works fine in a pythonscript run in Eclipse, but not run in the windows command line)
A missing ordinal suggests that it's finding the wrong version of the
library. This is likely to be related to the PATH setting, which
Windows uses to locate DLLs, as well as executables.
--
Sonja Jankowfsky
UR Hydrologie-Hydraulique
Cemagref de Lyon
3 bis quai Chauveau CP 220
69336 Lyon Cedex 09
FRANCE
Tel : (+33)4 72 20 86 11 Fax : (+33)4 78 47 78 75
I added C:\GRASS-4-SVN\msys\bin to my PATH, and now I only have the problem with the SSLEAY32.dll.
Sonja Jankowfsky a écrit :
Many thanks for your tips!
Concerning the missing ordinal, I had a check and I only have 2 SSLEAY32.dll libraries on my machine:
The one in C:\GRASS-4-SVN\extralib, which is indicated in the PATH and one other in C:\OSGeo4w\bin, but that's not in the PATH. So windows should take the first one.
I think, the problem with the ordinal is coming from something else, but I don't know what.
Concerning the second problem I added GRASS_SH = C:\GRASS-4-SVN\msys\bin\sh.exe (I only have msys inside GRASS installed) to the environment variables.
Now, I get a different error message:
C:\GRASS-4-SVN/scripts/v.db.addcol: line 55: basename: command not found
C:\GRASS-4-SVN/scripts/v.db.addcol: line 63: basename: command not found
C:\GRASS-4-SVN/scripts/v.db.addcol: line 66: which: command not found
ERREUR :awk required, please install awk or gawk first
do I have to add other executable to the environment variables?
Glynn Clements a écrit :
Sonja Jankowfsky wrote:
in C:\Windows\system32\cmd.exe
C:\GRASS-4-SVN\bin\v.in.ogr.exe
result: L'ordinal 284 est introuvable dans la bibliothèque de liaisons dynamique SSLEAY32.dll.
I think that's something like "the ordinal 284 could not be found in
the dynamic library SSLEAY32.dll". SSLeay is the original name of
OpenSSL, which is used by some of the libraries used by GDAL
(typically database libraries).
(call to v.in.ogr works fine in a pythonscript run in Eclipse, but not run in the windows command line)
A missing ordinal suggests that it's finding the wrong version of the
library. This is likely to be related to the PATH setting, which
Windows uses to locate DLLs, as well as executables.
--
Sonja Jankowfsky
UR Hydrologie-Hydraulique
Cemagref de Lyon
3 bis quai Chauveau CP 220
69336 Lyon Cedex 09
FRANCE
Tel : (+33)4 72 20 86 11 Fax : (+33)4 78 47 78 75
I added C:\GRASS-4-SVN\msys\bin to my PATH, and now I only have the problem with the SSLEAY32.dll.
Sonja Jankowfsky a écrit :
Many thanks for your tips!
Concerning the missing ordinal, I had a check and I only have 2 SSLEAY32.dll libraries on my machine:
The one in C:\GRASS-4-SVN\extralib, which is indicated in the PATH and one other in C:\OSGeo4w\bin, but that's not in the PATH. So windows should take the first one.
I think, the problem with the ordinal is coming from something else, but I don't know what.
Concerning the second problem I added GRASS_SH = C:\GRASS-4-SVN\msys\bin\sh.exe (I only have msys inside GRASS installed) to the environment variables.
Now, I get a different error message:
C:\GRASS-4-SVN/scripts/v.db.addcol: line 55: basename: command not found
C:\GRASS-4-SVN/scripts/v.db.addcol: line 63: basename: command not found
C:\GRASS-4-SVN/scripts/v.db.addcol: line 66: which: command not found
ERREUR :awk required, please install awk or gawk first
do I have to add other executable to the environment variables?
Glynn Clements a écrit :
Sonja Jankowfsky wrote:
in C:\Windows\system32\cmd.exe
C:\GRASS-4-SVN\bin\v.in.ogr.exe
result: L'ordinal 284 est introuvable dans la bibliothèque de liaisons dynamique SSLEAY32.dll.
I think that's something like "the ordinal 284 could not be found in
the dynamic library SSLEAY32.dll". SSLeay is the original name of
OpenSSL, which is used by some of the libraries used by GDAL
(typically database libraries).
(call to v.in.ogr works fine in a pythonscript run in Eclipse, but not run in the windows command line)
A missing ordinal suggests that it's finding the wrong version of the
library. This is likely to be related to the PATH setting, which
Windows uses to locate DLLs, as well as executables.
--
Sonja Jankowfsky
UR Hydrologie-Hydraulique
Cemagref de Lyon
3 bis quai Chauveau CP 220
69336 Lyon Cedex 09
FRANCE
Tel : (+33)4 72 20 86 11 Fax : (+33)4 78 47 78 75