OSError: [Errno 2] Nessun file o directory di questo tipo durante l’utilizzo del sottoprocesso Python in Django

| | | | |

Sto cercando di eseguire un programma per effettuare alcune chiamate di sistema all'interno del codice Python utilizzando subprocess.call() che genera il seguente errore:

Traceback (most ultima chiamata recente): File "<console>", riga 1, in <module> File "/usr/lib/python2.7/subprocess.py", riga 493, nella chiamata return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py" , riga 679, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", riga 1249, in _execute_child raise child_exception OSError: [Errno 2] Nessun file o directory di questo tipo 

Il mio codice Python effettivo è il seguente:

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"+url crop = "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) #chiamate di sistema: subprocess.call(crop) 

Posso ricevere consigli pertinenti su come risolvere questo problema?

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