Palinuro
Palinuro

Reputation: 338

Is there a way to set PYTHONPATH permanently?

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?

Upvotes: 1

Views: 1948

Answers (3)

binds
binds

Reputation: 125

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.

Upvotes: 1

I break things
I break things

Reputation: 326

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

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

Upvotes: 3

vht981230
vht981230

Reputation: 4508

Have you try adding the line you mention

export PYTHONPATH=$(pwd)

to ~/.bashrc or ~/.profile?

Upvotes: 4

Related Questions