를 실행, 나는 오류를 얻을파이썬 : 오류 내가 CentOS는에서 다음과 같은 기능을 실행할 때 subprocess.popen
def install_requests_lib():
try:
import requests
return
except ImportError, e:
print "module does not exist, installing..."
if(platform.system().lower()=='darwin'):
print "install requests before proceeding, run **sudo pip install requests**"
sys.exit(2)
elif(platform.system().lower()=='linux'):
print "installing"
p=Popen(["yum","-y","install","python-requests"], stdout=PIPE, shell=True)
p.communicate()
print p.returncode
오류 : 잘못 왜
module does not exist, installing...
installing
You need to give some command
1
내가 알아낼 수 없습니다.
나는 stdin=PIPE
인수로 실행했지만 여전히 같은 오류가 발생합니다.
스크립트에'yum install'을 할 수있는 권한이 있습니까? 모든 출력을 보려면 stderr을 stdout으로 재지 정할 수도 있습니다. – grundic