[Distutils] failing to build quadtree if the package is already installed

Kurt Schwehr schwehr at gmail.com
Fri Jan 26 17:11:13 CET 2007

Hi All,

Sorry if this kind of thing has already been discussed.  I am packaging
quadtree for Mac OSX/fink (deb based package management) and am getting a
failed build if the package is alread installed and I am trying to do a
rebuild.  Can someone point me at what needs to be changed?  Is this because
quadtree is a namespace?


cd externals/Quadtree && /sw/bin/python2.5 setup.py install

Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    from setuptools import setup, Extension
  File "/sw/lib/python2.5/site-packages/setuptools/__init__.py", line 2, in
    from setuptools.extension import Extension, Library
  File "/sw/lib/python2.5/site-packages/setuptools/extension.py", line 2, in
    from dist import _get_unpatched
  File "/sw/lib/python2.5/site-packages/setuptools/dist.py", line 6, in
    from setuptools.command.sdist import sdist
  File "/sw/lib/python2.5/site-packages/setuptools/command/sdist.py", line
3, in <module>
    import os, re, sys, pkg_resources
  File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 2499, in
    add_activation_listener(lambda dist: dist.activate())
  File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 599, in
  File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 2499, in
    add_activation_listener(lambda dist: dist.activate())
  File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 2048, in
    map(declare_namespace, self._get_metadata('namespace_packages.txt'))
  File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 1667, in
    _handle_ns(packageName, path_item)
  File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 1638, in
    loader.load_module(packageName); module.__path__ = path
  File "/sw/lib/python2.5/pkgutil.py", line 238, in load_module
    mod = imp.load_module(fullname, self.file, self.filename, self.etc)
  File "/sw/src/fink.build/quadtree-py25-0.1.1-1/pcl-0.11-20070118/externals/Quadtree/quadtree/__init__.py",
line 2, in <module>
    from _tree import Quadtree
ImportError: No module named _tree

cat quadtree/__init__.py

from _tree import Quadtree

And, here is the setup.py file:

from setuptools import setup, Extension
_tree = Extension('quadtree._tree',
setup(name          = 'Quadtree',
      version       = '0.1.1',
      description   = 'Quadtree spatial index for Python GIS',
      license       = 'BSD',
      keywords      = 'spatial index',
      author        = 'Sean Gillies',
      author_email  = 'sgillies at frii.com',
      maintainer    = 'Sean Gillies',
      maintainer_email  = 'sgillies at frii.com',
      url               = 'http://icon.stoa.org/trac/pleiades/wiki/QuadTree
      packages      = ['quadtree'],
      namespace_packages    = ['quadtree'],
      ext_modules   = [_tree],
      classifiers   = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: C',
        'Programming Language :: Python',
        'Topic :: Scientific/Engineering :: GIS',
        'Topic :: Database',
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/distutils-sig/attachments/20070126/2d8536d6/attachment.html 

More information about the Distutils-SIG mailing list