Home > OS >  Is there a way to set PYTHONPATH permanently?
Is there a way to set PYTHONPATH permanently?

Time:05-16

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?

CodePudding user response:

Have you try adding the line you mention

export PYTHONPATH=$(pwd)

to ~/.bashrc or ~/.profile?

CodePudding user response:

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

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

CodePudding user response:

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