Skip to main content
removed HTH and closing
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Solved!

In case this may be helpful to anyone, theThe solution for me was to declare an environment in subprocess.run:

env = os.environ.copy()
env["GDAL_DATA"] = "C:\\Program Files\\GDAL\\gdal-data"
env["PATH"] = (
            "C:\\GDAL"
            + os.pathsep
            + "C:\\Program Files\\GDAL"
            + os.pathsep
            + "C:\\Program Files\\TauDEM\\TauDEM5Exe")

Then either

subprocess.run([#mpiexecdir,"-n", "#ncores",#PitRemovedir, #DEMdir],shell=True,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,creationflags=subprocess.CREATE_NO_WINDOW)

or

subprocess.run([#PitRemovedir, #DEMdir],shell=True,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,creationflags=subprocess.CREATE_NO_WINDOW)

works well.

I had come across some similar solutions, but these did not work for me:

Furthermore, there is another plugin for QGIS 3 called "drainage" which can be handy. It performs all TauDEM processing as batch.

Cheers,

Solved!

In case this may be helpful to anyone, the solution for me was to declare an environment in subprocess.run:

env = os.environ.copy()
env["GDAL_DATA"] = "C:\\Program Files\\GDAL\\gdal-data"
env["PATH"] = (
            "C:\\GDAL"
            + os.pathsep
            + "C:\\Program Files\\GDAL"
            + os.pathsep
            + "C:\\Program Files\\TauDEM\\TauDEM5Exe")

Then either

subprocess.run([#mpiexecdir,"-n", "#ncores",#PitRemovedir, #DEMdir],shell=True,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,creationflags=subprocess.CREATE_NO_WINDOW)

or

subprocess.run([#PitRemovedir, #DEMdir],shell=True,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,creationflags=subprocess.CREATE_NO_WINDOW)

works well.

I had come across some similar solutions, but these did not work for me:

Furthermore, there is another plugin for QGIS 3 called "drainage" which can be handy. It performs all TauDEM processing as batch.

Cheers,

The solution for me was to declare an environment in subprocess.run:

env = os.environ.copy()
env["GDAL_DATA"] = "C:\\Program Files\\GDAL\\gdal-data"
env["PATH"] = (
            "C:\\GDAL"
            + os.pathsep
            + "C:\\Program Files\\GDAL"
            + os.pathsep
            + "C:\\Program Files\\TauDEM\\TauDEM5Exe")

Then either

subprocess.run([#mpiexecdir,"-n", "#ncores",#PitRemovedir, #DEMdir],shell=True,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,creationflags=subprocess.CREATE_NO_WINDOW)

or

subprocess.run([#PitRemovedir, #DEMdir],shell=True,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,creationflags=subprocess.CREATE_NO_WINDOW)

works well.

I had come across some similar solutions, but these did not work for me:

Furthermore, there is another plugin for QGIS 3 called "drainage" which can be handy. It performs all TauDEM processing as batch.

Source Link

Solved!

In case this may be helpful to anyone, the solution for me was to declare an environment in subprocess.run:

env = os.environ.copy()
env["GDAL_DATA"] = "C:\\Program Files\\GDAL\\gdal-data"
env["PATH"] = (
            "C:\\GDAL"
            + os.pathsep
            + "C:\\Program Files\\GDAL"
            + os.pathsep
            + "C:\\Program Files\\TauDEM\\TauDEM5Exe")

Then either

subprocess.run([#mpiexecdir,"-n", "#ncores",#PitRemovedir, #DEMdir],shell=True,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,creationflags=subprocess.CREATE_NO_WINDOW)

or

subprocess.run([#PitRemovedir, #DEMdir],shell=True,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,creationflags=subprocess.CREATE_NO_WINDOW)

works well.

I had come across some similar solutions, but these did not work for me:

Furthermore, there is another plugin for QGIS 3 called "drainage" which can be handy. It performs all TauDEM processing as batch.

Cheers,