Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

754
Views
Laravel: error fatal de Python: _Py_HashRandomization_Init: no se pudieron obtener números aleatorios para inicializar Python Estado de tiempo de ejecución de Python: preinicializado

Puedo intentar ejecutar el script de Python en Laravel. Estoy usando composer require symfony/process para esto. En realidad, no quiero usar shell_exec() . Cuando intento ejecutarlo, me devuelve un error. En la línea de comando, todo está bien. Mi secuencia de comandos de python se encuentra en la carpeta pública.

Mi controlador:

 use Symfony\Component\Process\Process; use Symfony\Component\Process\Exception\ProcessFailedException; public function plagiarismCheck() { $process = new Process(['C:/Program Files/Python39/python.exe', 'C:/Users/User/Desktop/www/abyss-hub/public/helloads.py']); $process->run(); // executes after the command finishes if (!$process->isSuccessful()) { throw new ProcessFailedException($process); } return $process->getOutput(); }

Escritura de Python:

 print('Hello Python')

Error:

 The command ""C:/Program Files/Python39/python.exe" "C:/Users/User/Desktop/www/abyss-hub/public/helloads.py"" failed. Exit Code: 1(General error) Working directory: C:\Users\User\Desktop\www\abyss-hub\public Output: ================ Error Output: ================ Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python Python runtime state: preinitialized.
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!