How do I know python path on linux ubuntu?

You can type which python on the ubuntu terminal and it will give the Python installed location path.


First, I hope you don't really set PYTHONPATH=/etc, /etc is for configuration files, not python libraries.

You can see what an environment variable is set to by using echo, e.g.: echo $PYTHONPATH. If the variable has not been set it will be blank. You can also use env to get a list of all environment variables, and couple with grep to see if a particular one is set, e.g. env | grep PYTHONPATH.


use printenv command, it will print all the environment variables, to only print PYTHONPATH use: printenv PYTHONPATH