Reputation: 338
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
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
Reputation: 326
Put the following line in your ~/.bashrc file:
export PYTHONPATH=/the/location/of/the/path
Upvotes: 3
Reputation: 4508
Have you try adding the line you mention
export PYTHONPATH=$(pwd)
to ~/.bashrc
or ~/.profile
?
Upvotes: 4