Problem : you want to call a Python script from a PHP page on your web server. Sometimes it does not work. To solve the problem do the following:
Install Python Anaconda in /opt/anaconda (download from conda.io)
Execute installation script and put Anaconda in /opt/anaconda3/:
sudo ./Anaconda3-5.0.1-Linux-x86_64.sh
Install numpy and BioPython :
conda install numpy
conda install biopython
In the public_html directory where you python script reside, do the following:
sudo chown www-data script.py
sudo chgrp www-data script.py
sudo chmod a+x script.py
Then in your Python script (script.py) put as first lines:
#!/opt/anaconda/bin/python
import sys
sys.path.append('/opt/anaconda3/bin')