I know you can add multiple locations to python path by separating them by colons ie:
export PYTHONPATH=~/one/location:~/second/location
etc.
I have several locations to add and it looks messy using the above method. Is there a way of adding them in multiple lines? This is what I tried and the last line erases the first.
export PYTHONPATH=~/one/location
export PYTHONPATH=~/second/location
Thanks
Background. Setting the PYTHONPATH environment variable is an easy way to make Python modules available for import from any directory. This environment variable can list one or more directory paths which contain your own modules. On Windows, multiple paths are separated by semicolons.
PYTHONPATH=~/one/location:$PYTHONPATH
PYTHONPATH=~/second/location:$PYTHONPATH
export PYTHONPATH
Note the order here: I've made them so that each has higher precedence than the one before; you could switch what goes on each side of the colon if you want later entries to have lower precedence.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With