Using Python Subprocess module to import shapefile into postgres

by Aroop Chakraborty   Last Updated May 28, 2018 10:22 AM

I am trying to use your mentioned code..but getting an error.

The code used is mentioned below:

import os import subprocess

cmd = 'shp2pgsql -s 4326 E:\Forest\ForestFire\28052018\VNP14IMGTDL_NRT_Global_24h.shp vnp14imgtdl_nrt_global_24h | psql -h localhost -d scripting -U postgres -P postgres -q', shell=True)

The error it reproduces is while running in Python command line :

'shp2pgsql' is not recognized as an internal or external command, operable program or batch file. 255

What can I do?

Related Questions

Data limits & runtime of shp2pgsql?

Updated June 21, 2017 19:22 PM

PostGIS Batch File generation error

Updated October 06, 2016 08:09 AM


Updated April 24, 2018 15:22 PM