[Distutils] Distutils has no module named util, or is it a package problem?

Ian Bicking ianb at colorstudy.com
Thu Nov 10 23:05:51 CET 2005


Phillip J. Eby wrote:
> At 03:27 PM 11/10/2005 -0600, Ian Bicking wrote:
> 
>> Phillip J. Eby wrote:
>>
>>> At 10:15 AM 11/10/2005 -0800, Ben Bangert wrote:
>>>
>>>> I'm getting the following very odd behavior when downloading and
>>>> installing from subversion for Paste lately. The error makes it tough
>>>> to know if this is a Paste problem, a local problem (I've had it on
>>>> two different OSX machines now), or a setuptools problem.
>>>
>>>
>>> Check whether there is a distutils/util.py in your 
>>> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ 
>>> directory.
>>
>>
>> I realize now what the problem is.  I included this in the setup.py:
>>
>> import sys, os
>> sys.path.insert(0, os.path.dirname(__file__))
>> from paste.util import finddata
>>
>> This would actually work...
> 
> 
> I don't understand what you're trying to do; the setup script's 
> directory should already *be* on sys.path.

I wasn't sure, so I did it to be safe.  It shouldn't effect anything.

>> except it doesn't work when doing the sandbox install, and the 
>> exception comes during the sandbox phase.  I'm not sure why a sandbox 
>> installation is happening (zip_safe is explicitly set to False)?
> 
> 
> easy_install runs all setup scripts in a sandbox, since it has no way of 
> knowing whether a given script is "safe" until it actually runs it in 
> the sandbox.  Easier to ask forgiveness than permission, you might say.  :)

But apparently that import doesn't work when in the sandbox.  Why test 
it when setup() says explicitly that it isn't safe?

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Distutils-SIG mailing list