This may be simple but for quite some time I am getting this error!
On windows and python 2.7
import subprocess
p = subprocess.Popen(["C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\bq"])
Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\subprocess.py", line 710, in init errread, errwrite) File "C:\Python27\lib\subprocess.py", line 958, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified
When I run normally from command prompt with bq it runs perfectly. I am missing something with subprocess and bq.
Thanks
EDIT: After trying with several solutions provided below I found that when I use "shell=True" most of the commands work on windows shell!
e.g: p = subprocess.Popen('dir', shell=True)