I am working in:
- Eclipse
- Windows 7
- 64-bit Python 3.3
I want to import writer.pyx
(yes, Cython) into main.py
. At the top of main.py
, I have the appropriate import statement:
import writer
Both main.py
and writer.pyx
are in the same directory, and that directory is also in Windows' PYTHONPATH environment variable. However, it gives me the error ImportError: No module named 'writer'
. So, as far as I can tell, it should be working.
But, here's the kicker: in that same directory, there's a file called reader.pyx
that I'm also importing in main.py
- and it works perfectly. No issues, no errors.
So, clear summary:
main.py
isimport
ingwriter.pyx
andreader.pyx
- All three files are in the same directory (and PYTHONPATH lists that directory)
reader.pyx
imports fine, butwriter.pyx
throws anImportError: No module named 'writer'
Any ideas as to how I can fix this?
Visual representation:
import reader
import writer
def function():
# code
P.S. This is not my code, and it used to run just fine on this very computer, and the code has not been changed since. This leads me to believe it's an environment problem, but I'm not sure what. Something with Cython, perhaps? I don't have any real experience with it.