python: set pythonpath on persistent on ubuntu

 

first test if its set:

 

echo $PYTHONPATH

 

 

if you want to set it temporarily

 

export PYTHONPATH=/home/:$PYTHONPATH

 

 

note that you add the desired path you want (in my case /home) and additionally append the $PYTHONPATH variable othewise you'll delete your exisiting path and will only get /home on your path. this is important!

 

if you want to make it persistent add the command on ~/.bashrc.do

vim ~/.bashrc

 

add the command at the end of the file

 

export PYTHONPATH=/home/:$PYTHONPATH

 

reboot and check if your desired PYTHONPATH is set doing:

 

echo $PYTHONPATH

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *