2

How can I add a new pythonpath in Geany? Is something in the preferences/options that I'm missing? I tried adding this in .bashrc , but it didn't work.

export PYTHONPATH=/mypath

What I do now is to add these two lines in the top of every script, but it's not good as a permanent solution:

import sys
sys.path.append('mypath')

2 Answers 2

5

Add export PYTHONPATH=$PYTHONPATH:/mypath to /etc/profile and reboot.

That should work for you.

2
  • yes it did. thank you. if it's no big deal, please tell me why it worked and it didn't work with bashrc
    – kalfasyan
    May 30, 2014 at 10:08
  • 3
    .bashrc is a configuration file just for bash, etc/profile is run when you login. I imagine Geany does not start bash to run your scripts. May 30, 2014 at 10:14
1

You can also do it without modifying any system configuration.

In Geany go to Edit > Preferences > Tools

Terminal field should say something like:

x-terminal-emulator -e "/bin/sh %c"

Change it to:

x-terminal-emulator -e "env PYTHONPATH=/mypath /bin/sh %c"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.