I'm trying to run sqoop command inside Python script. I had no problem to do that trough shell command, but when I'm trying to execute python stript:
sqoopcom="sqoop import --direct --connect abcd --username abc --P --query "queryname" "
The build in
exec statement that you're using is for interpreting python code inside a python program.
What you want is to execute an external (shell) command. For that you could use
call from the subprocess module
import subprocess subprocess.call(["echo", "Hello", "World"])