Robert Kern | 29 Jan 2012 18:47
Picon
Gravatar

Re: Installing just a .pxd with Distutils

On 1/29/12 3:46 PM, Thomas Wiecki wrote:
> Hi,
>
> there still seems to be an issue with importing the module. It works
> fine when calling functions but complains that gsl is not cimported
> when trying to use a gsl type.
>
> cdef gsl.gsl_integration_workspace * W
>
> Error compiling Cython file:
> ------------------------------------------------------------
> ...
>
>      return gsl.gsl_ran_gaussian_pdf(x, sigma) + mu
>
> cdef double cdf_numerical(double x, double mu, double sigma):
>      cdef double alpha, result, error, expected
>      cdef gsl.gsl_integration_workspace * W
>          ^
> ------------------------------------------------------------
>
> integrate.pyx:15:9: 'gsl' is not a cimported module
>
> The code in question lives here:
> https://github.com/twiecki/CythonGSL/blob/master/examples/integrate.pyx

This:

from cython_gsl import gsl

Should be this:

from cython_gsl cimport gsl

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


Gmane