79099474

Date: 2024-10-17 18:54:56
Score: 1
Natty:
Report link

I found that Python libraries were installed in two different paths on the server: One was '/usr/local/lib/python3.8/dist-packages', and the other one was '/usr/lib/python3/dist-packages'.

When I executed the scripts directly from the command line on the server, it did access the Pandas package from '/usr/local/lib/python3.8/dist-packages', whereas it was loading Pandas out of PHP using shell_exec() from '/usr/lib/python3/dist-packages', meaning it did load an older version of Pandas when executing the Python script out of PHP.

So, executing the same Python3 scripts from command line and out of PHP did import the packages from different directories.

I did remove Python3 and both package directories, reinstalled Python3 and both Pandas and Matplotlib packages, and that solved the problem for me.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: schustischuster