2013-08-04 5 views
0
이것은 파이썬 빌드에서 발생

: 다음os.system을은 파일을 찾지 못하는 정말이

#is it executable 
print os.access("support/d8/d8", os.X_OK) 
#is it there in the shell 
os.system("test -f support/d8/d8 && echo \"found\" || echo \"not found\"") 

과 :

#run it 
os.system("support/d8/d8 --trace_exception with a bunch of files"); 

출력 :

True 
found 
sh: 1: support/d8/d8: not found 

나는 '돈 알았어. 실행 파일이 있습니다. 내가 그것을 시작할 때 왜 거기 있지 않은가?

+1

은 무엇입니까 발생 'support/d8/d8'의 내용? 'not found '는 인터프리터 나 라이브러리를 찾거나 초기화 할 수 없다는 것을 의미합니다. – phihag

+0

그것은 v8의 바이너리 버전입니다. – albertjan

+0

'subprocess.Popen'을 사용하지 않는 이유는 무엇입니까? 이런 종류의 일에 더 신뢰할 수 있어야합니다. –

답변

3

실행 파일 d8 (실행 중인데 comment에도 불구하고). 제 (트래비스) ​​시스템은 64, 그리고/또는 x86_32 라이브러리

  • linux-gate.so.1
  • libpthread.so.0
  • libstdc++.so.6
  • libm.so.6
  • libgcc_s.so.1
  • libc.so.6
모두가없는 경우

로더가 필요한 모든 라이브러리를 찾을 수 없으므로 실행 파일이 실행되지 않습니다. 정적으로 및/또는 x64 용으로 빌드하십시오. 파일 "지원/D8/D8"는 존재하지 않는이있는 경우

+0

감사합니다. 정적 x64 v8 구축에 대해 살펴 보겠습니다. – albertjan

+0

당신이 정확했습니다! – albertjan

0

m 왜 당신이 시도하지 않는 호출됩니다

os.system("./support/d8/d8 --trace_exception with a bunch of files"); 

./을 실행하는 동안 유사한 문제가 발생했습니다. 몇 가지 방법이 필요합니다.

+0

시도해 보았습니다 – albertjan

+1

-1 이것은 정상적인 시스템에서'system ('support/d8/d8 ...')과 동일합니다. 대부분의 경우, 슬래시가없는 파일을 실행하고 있었는데 실제로는 다른 의미가 있습니다. – phihag

+0

나쁘지 만, 이것은 동일합니다.그래, 난 슬래시없이 파일을 시도하고 이것이 문제가 될 수 있다고 결론 지었다. – innosam

0

는 "빅뱅 라인은"이 오류가

$ cat support/d8/d8 
#!/usr/bin/thisdoesnotexist 
echo "hello" 
$ chmod 755 support/d8/d8 
$ python 
Python 2.7.3 (default, Apr 10 2013, 06:20:15) 
[GCC 4.6.3] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import os 
>>> os.system("support/d8/d8 --wer") 
sh: 1: support/d8/d8: not found 
32512 

+0

d8 이진 파일입니다. – albertjan

관련 문제