Is there a way to set PYTHONPATH permanently?

Viewed 57

Every day, when I open an Ubuntu terminal and want to run a python project, I have to run previously export PYTHONPATH=$(pwd). Is there a way to avoid doing this every time I switch on my computer? Is there a way to set my PYTHONPATH permanently for that project?

3 Answers

Have you try adding the line you mention

export PYTHONPATH=$(pwd)

to ~/.bashrc or ~/.profile?

Put the following line in your ~/.bashrc file:

export PYTHONPATH=/the/location/of/the/path

You should be able to set it permanently through the ~/.bashrc file or ~/.profile file for your user. Just enter the line you showed into either of those files.

Related