I am trying to use setuptools in python to create an egg package, but I get this weird error:
error: each element of 'ext_modules' option must be an Extension instance or 2-tuple
How can I fix this?
I am trying to use setuptools in python to create an egg package, but I get this weird error:
error: each element of 'ext_modules' option must be an Extension instance or 2-tuple
How can I fix this?
Assuming that you already have setuptools installed, Edit setup.py of the egg package target and replace the import setup, Extension
in order to get them from setuptools.
from setuptools import setup, Extension, Command
Rational: setuptools redefines Extension
so it's possible that it does not recognize the object that you have in the ext_modules argument as a valid Extension object. Hence the error message.
ext_modules is one of the arguments of setup() method that describe the extension of your module, and it's specified in setup.py.
setup(name='foo', version='1.0', ext_modules=[Extension('foo', ['foo.c'])], )
This happens due to conflict with distutils from where the Extension is imported w.r.t setuptools. I see this error when installing gdsCAD so I had to update the setupext.py to sucessfully install