re.compile missing in python 2.3.3/2.3.4???

Discussion in 'Python' started by Steve, Jul 9, 2004.

  1. Steve

    Steve Guest

    Hi,

    I just installed a fresh copy of python 2.3.3 and python 2.3.4 and
    everytime a there's a call to re.compile, it says:
    Traceback (most recent call last):
    File "setup.py", line 76, in ?
    from distutils.core import setup
    File "/usr/lib/python2.2/distutils/core.py", line 16, in ?
    from distutils.util import grok_environment_error
    File "/usr/lib/python2.2/distutils/util.py", line 207, in ?
    _wordchars_re = re.compile(r'[^\\\'\"%s ]*' % string.whitespace)
    AttributeError: 'module' object has no attribute 'compile'

    First, how do I make the file 'setup.py' point to the directory:
    /opt/python-2.3.4/lib/python2.3/distutils instead. It keeps using the
    default, which is: /usr/lib/python2.2/distutils/. Second, is this
    related to why re.compile won't work? Please help!!!

    Steve
     
    Steve, Jul 9, 2004
    #1
    1. Advertising

  2. Steve <nospam@nopes> writes:

    > Hi,
    >
    > I just installed a fresh copy of python 2.3.3 and python 2.3.4 and
    > everytime a there's a call to re.compile, it says:
    > Traceback (most recent call last):
    > File "setup.py", line 76, in ?
    > from distutils.core import setup
    > File "/usr/lib/python2.2/distutils/core.py", line 16, in ?
    > from distutils.util import grok_environment_error
    > File "/usr/lib/python2.2/distutils/util.py", line 207, in ?
    > _wordchars_re = re.compile(r'[^\\\'\"%s ]*' % string.whitespace)
    > AttributeError: 'module' object has no attribute 'compile'
    >
    > First, how do I make the file 'setup.py' point to the directory:
    > /opt/python-2.3.4/lib/python2.3/distutils instead. It keeps using the
    > default, which is: /usr/lib/python2.2/distutils/. Second, is this
    > related to why re.compile won't work? Please help!!!


    Almost certainly.

    I'm a bit confused by what you're doing and what you've done <wink>.

    You built Python 2.3.4 from source with

    ./configure --prefix=/opt/python-2.3.4

    and ran "make install". This worked?

    You're now trying to install some third part package using
    "/opt/python-2.3.4/bin/python setup.py install" and *this* is failing
    in the manner above? Something else?

    At any rate, it sounds like your installation is a bit messed up.

    Cheers,
    mwh

    --
    Unfortunately, nigh the whole world is now duped into thinking that
    silly fill-in forms on web pages is the way to do user interfaces.
    -- Erik Naggum, comp.lang.lisp
     
    Michael Hudson, Jul 9, 2004
    #2
    1. Advertising

  3. Steve

    Steve Guest

    Michael,


    Michael Hudson wrote:
    > Steve <nospam@nopes> writes:
    >
    >
    >>Hi,
    >>
    >>I just installed a fresh copy of python 2.3.3 and python 2.3.4 and
    >>everytime a there's a call to re.compile, it says:
    >>Traceback (most recent call last):
    >> File "setup.py", line 76, in ?
    >> from distutils.core import setup
    >> File "/usr/lib/python2.2/distutils/core.py", line 16, in ?
    >> from distutils.util import grok_environment_error
    >> File "/usr/lib/python2.2/distutils/util.py", line 207, in ?
    >> _wordchars_re = re.compile(r'[^\\\'\"%s ]*' % string.whitespace)
    >>AttributeError: 'module' object has no attribute 'compile'
    >>
    >>First, how do I make the file 'setup.py' point to the directory:
    >>/opt/python-2.3.4/lib/python2.3/distutils instead. It keeps using the
    >>default, which is: /usr/lib/python2.2/distutils/. Second, is this
    >>related to why re.compile won't work? Please help!!!

    >
    >
    > Almost certainly.
    >
    > I'm a bit confused by what you're doing and what you've done <wink>.
    >
    > You built Python 2.3.4 from source with
    >
    > ./configure --prefix=/opt/python-2.3.4
    >
    > and ran "make install". This worked?
    >
    > You're now trying to install some third part package using
    > "/opt/python-2.3.4/bin/python setup.py install" and *this* is failing
    > in the manner above? Something else?
    >
    > At any rate, it sounds like your installation is a bit messed up.
    >
    > Cheers,
    > mwh
    >


    Thanks for taking the time out to answer my questiong. As a matter of
    fact, the problem turned out to be just the 'PYTHONPATH' variable
    pointing to an older installation (which resided in '/usr/bin').
    Changing this to '/opt/python-2.3.4/lib/python-2.3' fixed the issue.

    To your other question, yes installing the third party package by
    running "/opt/python-2.3.4/bin/python setup.py install" was failing
    because the Python interpreter kept looking for its libraries in
    '/usr/lib/python-2.2'.

    Thanks,

    Steve
     
    Steve, Jul 13, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    4
    Views:
    20,720
    Shishir19
    Mar 19, 2007
  2. Adam McCarthy

    Pyrex Compile - Missing Symbols in Python

    Adam McCarthy, Sep 25, 2004, in forum: Python
    Replies:
    0
    Views:
    466
    Adam McCarthy
    Sep 25, 2004
  3. Frost bite
    Replies:
    0
    Views:
    347
    Frost bite
    Sep 25, 2004
  4. Gary Herron
    Replies:
    2
    Views:
    699
    Bruno Desthuilliers
    Jul 4, 2006
  5. Nagaraj
    Replies:
    1
    Views:
    923
    Lionel B
    Mar 1, 2007
Loading...

Share This Page