Import error (miniconda3)


I’m trying to run a pygmt script in PHP, the problem that I have is that every time I run the script

$command = escapeshellcmd("sudo /opt/miniconda3/envs/pygmt/bin/python3

$arr_lon $arr_lat $arr_dep $arr_mag");
$output= shell_exec($command);
echo $output;

It fails in finding the pygmt module (The other modules work fine) but when I run the python script directly on the server it work fine.

I know this is more related to PHP or the permission on the system, but I already have the permissions for the Apache.

Does someone already have this problem and know how to fix this?


I have no idea about PHP. It would be better if you can post the messages when it fails to find pygmt.

One more thing, how did you install pygmt?