I switched to using the Cython.distutils.Extension but when trying to
use it through the setupegg.py wrapper (i.e. setuptools for
development install), I get:
>sudo python setupegg_switch.py develop
Traceback (most recent call last):
File "setupegg_switch.py", line 7, in <module>
execfile('setup_switch.py')
File "setup_switch.py", line 30, in <module>
ext_modules = [Extension("wfpt", ["src/wfpt.pyx"]),
#extra_compile_args=['-fopenmp'], extra_link_args=['-fopenmp']),
File "/home/wiecki/tools/cython/Cython/Distutils/extension.py", line
108, in __init__
**kw)
TypeError: unbound method __init__() must be called with Extension
instance as first argument (got Extension instance instead)
Any fix?
Thomas
Hi,
please do not hijack threads. Start a new one instead.
Stefan
The workaround is to make sure you import setuptools before distutils
and it will work fine.
The following just work fine for me :
---------------------------------------------------
from setuptools import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
setup (...)
---------------------------------------------------
-- Didrik
from Cython.Distutils import Extension
instead of
from distutils.extension import Extension
and see whether that still works?
Thomas
Sorry. I did try it, but it didn't work so I wanted to make sure it
wasn't an issue with my installation.
from setuptools import setup
from Cython.Distutils import Extension
Extension('foo', ['*.pxd'])
On Mon, Feb 6, 2012 at 12:49 PM, Thomas Wiecki