Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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')
share|improve this question

2 Answers 2

up vote 2 down vote accepted

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

That should work for you.

share|improve this answer
    
yes it did. thank you. if it's no big deal, please tell me why it worked and it didn't work with bashrc –  user143006 May 30 '14 at 10:08
2  
.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. –  Padraic Cunningham May 30 '14 at 10:14

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"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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