1

Background: I am trying to run a windows-installed version of python from within cygwin, rather than the cygwin version (some packages I am using prefer the non-cygwin version). The following post got me up and running: Using Windows Python from Cygwin. However, I am now having an issue.

Problem: The PYTHONPATH variable does not seem to be working for me. I try "import module1" when I am using python in an arbitrary directory. module1 is located here: c:\cygwin\home\mcsefl\testFolder\module1.py. And my PYTHONPATH variable is set in my .bashrc file in the following way: "export PYTHONPATH=$PYTHONPATH:/home/mcsefl/testFolder". However I still get a "No module named..." error.

Alternate tries: Since I am running the Windows Python, I thought perhaps python did not care about the cygwin environment variables (not sure if this is true..?) So, I also tried to set the windows PYTHONPATH env variable in the control panel of windows with no luck as well.

Thanks in advance

Community
  • 1
  • 1
  • I worked with it some more and found a solution. When Python loads it parses the PYTHONPATH variable and creates the sys.path list. It was not parsing my .bashrc line correctly, and would result in the third entry in the list below, which combines the Windows env variable entry with my entry from the .bashrc file and fails to separate with the colon separator. >> sys.path ['', 'C:\Python32', 'C:\cygwin\home\mcsefl\testFolder:\home\mcsefl\testFolder', 'C:\Python32\python32.zip', 'C:\Python32\DLLs', 'C:\Python32\lib', 'C:\Python32\lib\site-packages'] – user1946650 Jan 04 '13 at 02:34
  • I deleted the line in my .bashrc file that tried to set the PYTHONPATH variable and just let it be set by Windows. This corrects the problem. Side note: The title for this Question is a misnomer now that I re-read it. My issue was resolved without addressing that overall question. – user1946650 Jan 04 '13 at 02:35

1 Answers1

0

I deleted the line in my .bashrc file that tried to set the PYTHONPATH variable and just let it be set by Windows. This corrects the problem.

Side note: The title for this Question is a misnomer now that I re-read it. My issue was resolved without addressing that overall question

demongolem
  • 9,474
  • 36
  • 90
  • 105