Problem importing re module, please help...

Matthew Hirsch meh9 at cornell.edu
Tue Dec 17 03:29:54 EST 2002


Hi,

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?

Thanks,
Matt

ws1-okx:matt_h:271$ python
Python 2.1.1 (#3, Aug  1 2001, 18:47:53) 
[GCC 2.95.2 19991024 (release)] on hp-uxB
Type "copyright", "credits" or "license" for more information.
>>> import re
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/python/lib/python2.1/re.py", line 1, in ?
    #
ImportError: cannot import name compile
>>> 
ws1-okx:matt_h:272$ cd /usr/local/python/
ws1-okx:matt_h:273$ python
Python 2.1.1 (#3, Aug  1 2001, 18:47:53) 
[GCC 2.95.2 19991024 (release)] on hp-uxB
Type "copyright", "credits" or "license" for more information.
>>> import re
>>> 

...

ws1-okx:matt_h:276$ cd
ws1-okx:matt_h:277$ more .profile
# Default user .profile file (/usr/bin/sh initialization).

PYTHONHOME=$PYTHONHOME:/usr/local/python/bin/;export PYTHONHOME
PYTHONPATH=$PYTHONPATH:/usr/local/python/lib/python2.1;export
PYTHONPATH



More information about the Python-list mailing list