Where is the python path when I don't have .bash_profile?

I am running ubuntu and I do not have .bash_profile.

So my question is: where exactly is my python path installed?

As I can see what the current python path is by doing:

$PYTHON_PATH 

returns nothing?

+6
source share
4 answers

It is installed by the site module and the executable file of the interpreter itself. sys.path contains the current value.

+5
source

You can see your python path in python as follows:

 >> import sys >> print sys.path 
+4
source

you can create .bash_profile with your favorite editor and paste into it:

 export PYTHONPATH=$HOME/lib/python 

or something like that.

+1
source

echo $PYTHONPATH / etc / profile and / etc / bashrc are the bash global configuration files before searching in your home directory at startup. It is also safe to create .bash_profile if it does not exist.

Usually PYTHONPATH is empty.

0
source

Source: https://habr.com/ru/post/885544/


All Articles