Skip to main content
Fixed typos
Source Link
RalfFriedl
  • 1.7k
  • 3
  • 10
  • 11

You are missing environment values when invoking python from the web server that are present in your shell. Candidates are PATH and the variables mentioned in the python man page.

Try this:

env -i python3.6 test.py

You will likely get some error messages that will hopefully point to the problem. Then try variables that are present in your shell environment, like:

env -i PYTHONHOME=$PYTHONHOME python3.6 PYTHONHOME=$PYTHONHOME test.py

Add all necessary environment variables. When this works, add them to the call to the script. When calling the script, you have supply the actual values for the variables, you can't refer to them as $PYTHONHOME.

You are missing environment values when invoking python from the web server that are present in your shell. Candidates are PATH and the variables mentioned in the python man page.

Try this:

env -i python3.6 test.py

You will likely get some error messages that will hopefully point to the problem. Then try variables that are present in your shell environment, like:

env -i python3.6 PYTHONHOME=$PYTHONHOME test.py

Add all necessary environment variables. When this works, add them to the call to the script. When calling the script, you have supply the actual values for the variables, you can't refer to them as $PYTHONHOME.

You are missing environment values when invoking python from the web server that are present in your shell. Candidates are PATH and the variables mentioned in the python man page.

Try this:

env -i python3.6 test.py

You will likely get some error messages that will hopefully point to the problem. Then try variables that are present in your shell environment, like:

env -i PYTHONHOME=$PYTHONHOME python3.6 test.py

Add all necessary environment variables. When this works, add them to the call to the script. When calling the script, you have supply the actual values for the variables, you can't refer to them as $PYTHONHOME.

Source Link
RalfFriedl
  • 1.7k
  • 3
  • 10
  • 11

You are missing environment values when invoking python from the web server that are present in your shell. Candidates are PATH and the variables mentioned in the python man page.

Try this:

env -i python3.6 test.py

You will likely get some error messages that will hopefully point to the problem. Then try variables that are present in your shell environment, like:

env -i python3.6 PYTHONHOME=$PYTHONHOME test.py

Add all necessary environment variables. When this works, add them to the call to the script. When calling the script, you have supply the actual values for the variables, you can't refer to them as $PYTHONHOME.