NameError: Case mismatch for module name sys

Martin Erren martin.erren at brainforce.at
Fri May 10 12:06:04 EDT 2002


"Steve Holden":

> > in a package named "Sys" (not of my own). I need:
> >
> > import traceback, sys
> >
> > Then I get
> >
> > "NameError: Case mismatch for module name sys"
> > (filename lib\Sys\Sys.py)
> >
> > I don't need "Sys" in the package,
> > but "sys" in the python-standard lib.
> >
> > Is the namespace case-insensitive, but I have to address
> > it case-sensitive?
> >
> The problem arises because Python has to deal not only with Linux and other
> environments where the filesystem is case-sensitive, but also with Windows
> and others where it isn't.

Oh, this sounds plausible. I'm working on NT.

> > Can I "leave" the package-Directory in imports explicitely?
> >
> Not quite sure what this question means -- whoever provided you with this
> package doesn't appear to be very experienced with Python. What exactly is
> it you want to do?

I'm not, too. In fact, this is written for Windows. I want to say:
Don't take Sys.py in package Sys, but "sys" in Standard-Lib.
Or say: "Always look in python-standard lib first"

When this is not possible, I try to write a wrapper in another package.

Thanks, Martin






More information about the Python-list mailing list