Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I have an Errno 13 Permission denied with subprocess in python

The line with the issue is

ret=subprocess.call(shlex.split(cmd))

cmd = /usr/share/java -cp pig-hadoop-conf-Simpsons:lib/pig-0.8.1-cdh3u1-core.jar:lib/hadoop-core-0.20.2-cdh3u1.jar org.apache.pig.Main -param func=cat -param from =foo.txt -x mapreduce fsFunc.pig 

The error is.

File "./run_pig.py", line 157, in process
    ret=subprocess.call(shlex.split(cmd))
File "/usr/lib/python2.7/subprocess.py", line 493, in call
  return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
  errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
  raise child_exception
OSError: [Errno 13] Permission denied

Let me know if any more info is needed. Any help is appreciated. Thanks.

like image 265
wDroter Avatar asked Oct 02 '12 13:10

wDroter


2 Answers

The error indicates that /usr/share/java does not have permissions that will allow you to execute it, probably because it is a directory, not an executable.

Find the location of the java executable on your Ubuntu machine (probably /usr/bin/java) and change /usr/share/ to point to the right place.

like image 198
Wooble Avatar answered Nov 14 '22 23:11

Wooble


just type chmod -R 777 /your/project/

its works for my...

like image 22
Tuki Avatar answered Nov 14 '22 21:11

Tuki