f



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

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

0
Steve
7/9/2004 2:18:05 AM
comp.lang.python 77058 articles. 6 followers. Post Follow

2 Replies
928 Views

Similar Articles

[PageSpeed] 53

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
0
mwh (704)
7/9/2004 10:47:48 AM
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

0
Steve
7/13/2004 6:43:06 AM
Reply: