influxdata / influx-cli

CLI for managing resources in InfluxDB v2
MIT License
61 stars 23 forks source link

CLI not returning when called from Python #463

Open Fr4nc3sc0NL opened 1 year ago

Fr4nc3sc0NL commented 1 year ago

I'm trying to invoke the CLI from Python to upload some csvs, however the process never returns. I tried the following and variations on it:

p = subprocess.run(["influx write --bucket Tutorial -f data_hist.csv"]    , shell=True)
q = subprocess.run(["influx write --bucket Tutorial -f data_forecast.csv"], shell=True)

This shell script works fine and returns:

influx write --bucket Tutorial -f data_hist.csv
influx write --bucket Tutorial -f data_forecast.csv

Do you have any hunch what might be going on?

(Mirror https://stackoverflow.com/questions/74843134/influxdb-cli-does-not-return-when-called-from-python)