Gracefully handling missing dependencies in bootstrap.py
Bug #410528 reported by
Erik Karulf
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Buildout |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
I was using zc.buildout on a brand-new ubuntu machine when I was met with the following cryptic error message.
18:46 erik@fozzie % python bootstrap.py
Traceback (most recent call last):
File "bootstrap.py", line 76, in <module>
ws.
AttributeError: 'NoneType' object has no attribute 'location'
Exit 1
It turns out that I did not have the setuptools package installed.
Would it be possible to catch and display the error in a more graceful way?
try:
import setuptools
except ImportError:
print "setuptools dependency not satisfied."
import sys
sys.exit(1)
Changed in zc.buildout: | |
status: | Confirmed → Fix Committed |
To post a comment you must log in.
On Fri, Aug 7, 2009 at 7:49 PM, Erik Karulf<email address hidden> wrote: pkg_resources. Requirement. parse(' setuptools' )).location
> Public bug reported:
>
> I was using zc.buildout on a brand-new ubuntu machine when I was met
> with the following cryptic error message.
>
> 18:46 erik@fozzie % python bootstrap.py
> Traceback (most recent call last):
> File "bootstrap.py", line 76, in <module>
> ws.find(
> AttributeError: 'NoneType' object has no attribute 'location'
> Exit 1
>
> It turns out that I did not have the setuptools package installed.
>
> Would it be possible to catch and display the error in a more graceful
> way?
My guess is that setuptools is installed, but without it's egg info.
Were you using the system Python?
Can you import pkg_resources?
In any case, I *can* an a check for this situation. I shouldn't have to, but ...
Jim
--
Jim Fulton