Monday, 15 September 2014

python - How can I set PYTHONPATH in fish? -



python - How can I set PYTHONPATH in fish? -

the next works in bash:

~$ echo $pythonpath <nothing> ~$ export pythonpath=/path/to/test/folder ~$ echo $pythonpath /path/to/test/folder ~$ python -m test_script hello world

but not in fish:

welcome fish, friendly interactive shell type help instructions on how utilize fish ~> echo $pythonpath <nothing> ~> set --universal pythonpath /path/to/test/folder ~> echo $pythonpath /path/to/test/folder ~> python -m test_script /usr/bin/python: no module named test_script

i've tried set, set --global , set --universal.

how can set pythonpath in fish? (if matters, i'm running ubuntu 14.04.)

setting variable not sufficient, must export (as in bash). exporting means subprocesses (like python call) value too.

from fish documentation:

-x or --export causes specified environment variable exported kid processes

so direct equivalent bash directive be:

~> set --export pythonpath /path/to/test/folder

you add together --universal or other arguments, here value temporary, matches original bash example.

(found reply via a similar question.)

python ubuntu fish

No comments:

Post a Comment