Problem importing re module, please help...

Fredrik Lundh fredrik at pythonware.com
Tue Dec 17 12:23:16 EST 2002


Matthew Hirsch wrote:

> I'm having trouble importing the re module while working in my home
> directory.  It works when I cd to the python directory.  I thought I
> have my profile set up correctly but maybe not. What am I doing wrong?

is the "re.py" file really the file you got with Python?  (in my copy
of 2.1.1, the import statement is on line 28 or so, not on line 1).

if you start the interpreter as "python -v", it will print all imports to
standard output.  check the output carefully, to make sure it's not
picking up the wrong version of some module.

for more clues, import the "sys" module, and check that sys.path
contains what you think it should.

</F>





More information about the Python-list mailing list