如何在PHP中运行Python脚本时调试错误'sh:1:python3:not found'

I want to run my Python script using PHP's shell_exec() and xammp on Mac. When I run it on terminal it is working, but when I run it on browser it shows this error 'sh: 1: python3: not found'

PHP

$command = escapeshellcmd("python3 scrape.py");
$command_output = shell_exec($command." 2>&1");

echo $command_output;

Python

#!/usr/bin/env python3
import cgi,cgitb
import urllib.request

from bs4 import BeautifulSoup
from bs4.element import Comment
from datetime import datetime
import re
import json

print ("Content-Type: text/plain;charset=utf-8
")

print("hello")