Cygwin and path issues

Berlin Brown berlin.brown at gmail.com
Tue May 6 10:40:10 EDT 2008


I am trying to run some basic unit tests, but I can't get the paths
setup in python/cygwin to pick up my modules.

This code works fine in linux and I installed python through cygwin
not as part of the win32 install.


DIR_PATH =
os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
PROJECT_HOME = os.path.join(DIR_PATH, '..', '..', '..')

print("INFO: project_home=%s" % PROJECT_HOME)

EXTRA_PATHS = [
  DIR_PATH,
  os.path.join(PROJECT_HOME, 'projects', 'ghostnet'),
  os.path.join(PROJECT_HOME, 'google_appengine'),
  os.path.join(PROJECT_HOME, 'google_appengine', 'lib', 'webob'),
  os.path.join(PROJECT_HOME, 'google_appengine', 'lib', 'yaml', 'lib')
]
sys.path = EXTRA_PATHS + sys.path

print sys.path

---------------

in my ~/.bash_profile

I also included the following.

export PYTHONPATH=/cygdrive/c/projects/projects_ecl/botlist:/cygdrive/
c/projects


Basically, I tried to add the module directory locations in my code;
also I tried to add the absolute path to my PYTHONPATH.

None of these approaches work.  I get the following error, which I
dont get on the linux side:

Traceback (most recent call last):
  File "run_all_tests.py", line 108, in <module>
    from django.conf import settings
ImportError: No module named django.conf



More information about the Python-list mailing list