Skip to content Skip to sidebar Skip to footer

Subprocess Gives An Error. "the System Cannot Find The File Specified"

This is my code: import urllib import requests from bs4 import * from subprocess import Popen,PIPE import os connectString = 'SYSTEM/mediadot123' def runSqlQuery(sqlCommand, con

Solution 1:

Consider using an absolute path for your command-execution. Some binaries are not located in PATH depending on your user, system and software installation.

To find out where sqlplus resides, run the following in cmd.exe: where sqlplus and that should give you the absolute path.

Then simply do:

Popen(['C:/path/sqlplus.exe', '-S', ...])

Also to find out what's actually in your PATH environment variable, you could do the following:

print(os.environ['PATH'])

Post a Comment for "Subprocess Gives An Error. "the System Cannot Find The File Specified""