OSError: [Errno 2] 在 Django 中使用 python 子進程時沒有這樣的文件或目錄

| | | | |

我正在嘗試運行一個程序以使用 subprocess.call() 在 Python 代碼中進行一些系統調用,這會引發以下錯誤:

Traceback(大多數最近通話最後一次):文件“<console>”,第 1 行,在 <module>文件“/usr/lib/python2.7/subprocess.py”,第 493 行,調用 return Popen(*popenargs, **kwargs).wait() 文件“/usr/lib/python2.7/subprocess.py” ,第 679 行,在 __init__ errread, errwrite) 文件“/usr/lib/python2.7/subprocess.py”,第 1249 行,在 _execute_child raise child_exception OSError: [Errno 2] No such file or directory 

我的實際Python代碼如下:

url = "/media/videos/3cf02324-43e5-4996-bbdf-6377df448ae4.mp4" real_path = "/home/chanceapp /webapps/chanceapp/chanceapp"+url fake_crop_path = "/home/chanceapp/webapps/chanceapp/chanceapp/fake1"+url fake_rotate_path = "/home/chanceapp/webapps/chanceapp.chanceapp/fake2"+urlcrop = "ffmpeg - i %s -vf "%(real_path)+"crop=400:400:0:0 "+ "-strict -2 %s"%(fake_crop_path) rotate = "ffmpeg -i %s -vf "%(fake_crop_path) +"transpose=1 "+"%s"%(fake_rotate_path) move_rotated = "mv"+" %s"%(fake_rotate_path)+" %s"%(real_path) delete_cropped = "rm "+"%s"%( fake_crop_path) #系統調用:subprocess.call(crop) 

我可以就如何解決這個問題獲得一些相關建議嗎?

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

News


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method