views:

250

answers:

1

I have 2 hard-drives, C:\ and D:\

Django imports correctly (which is in my C drive), but my application is on my D drive. I can't move it to the C drive because of some back-up software I'm running/

I'm trying to get auto-complete to work in Komodo Edit 5 which works fine for Django, but not for my application. There are a few other reasons for wanting this as well (one of them being my rampant OCD). I have added D:\dev\projects to my PYTHONPATH and my application is a couple folders deep from there. I included a ; between variables but not at the end, and I left off the trailing slash. I'm on Win XP. Here's my exact PYTHONPATH in my settings:

C:\Python26\Lib\site-packages\django-trunk;D:\dev\projects

and here is my Python path as a list output by os.environ['PYTHONPATH'].split(os.pathsep)

['C:\\Python26\\Lib\\site-packages\\django-trunk', 'D:\\dev\\projects']

Why doesn't this work? Django runs OK for my app that is there, but I understand that Django sets an environment variable dynamically in manage.py. I don't get it. I've restarted my computer, and now I'm pulling out my hair.

+2  A: 

Have you tried adding Additional import directories in Edit/Preferences/ under Languages/Python in Komodo?

Edit: I think you can also add a .pth file in [komodo-install-dir]/lib/mozilla/python/ or C:\[PythonVersion]\Lib\site-packages\ containing all other path you might want to be available. Not sure wich way is more appropriate in your case.

Xavier
@Xavier Thanks! Well, it doesn't make me feel as cozy as just working automatically would, but it fixed the problem for Komodo. I still can't directly import my modules from Python's shell of course (unless I use Django's manage.py shell), but at least I get code completes now.
orokusaki
@Xavier I just changed my PYTHONPATH to include the path directly to my project folder (VS just the folder two levels up containing it), and now it works without the directory being in Komodo.
orokusaki
@orokusaki Great you found a cleaner way (: At my job we also use a the PYTHONPATH to import our main libs, but I found out a .pth also that import other directories on the network. So I guess both method works.
Xavier
@Xavier Not to get too Facebook here, but what sort of software does your company work on in Python? Thanks again, BTW.
orokusaki
Mostly CG software and pipeline. You're welcome (:
Xavier