Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 665386

Summary: sci-libs/scipy-0.19.1 with dev-python/cython-0.28.4 - AttributeError: 'cython_function_or_method' object has no attribute '__func__'
Product: Gentoo Linux Reporter: Marc Vinyals <mrc_timer>
Component: Current packagesAssignee: Gentoo Science Related Packages <sci>
Status: RESOLVED OBSOLETE    
Severity: normal CC: admin, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info

Description Marc Vinyals 2018-09-06 18:00:40 UTC
Created attachment 546122 [details]
emerge --info

When trying to import the Python module scipy.spatial.qhull with sci-libs/scipy-0.19.1 and dev-python/cython-0.28.4 I get the following error:

$ python3
Python 3.6.5 (default, Aug  6 2018, 10:52:07) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.spatial.qhull
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/site-packages/scipy/spatial/__init__.py", line 95, in <module>
    from .qhull import *
  File "qhull.pyx", line 2224, in init scipy.spatial.qhull
AttributeError: 'cython_function_or_method' object has no attribute '__func__'

It seems that scipy versions older than 1.0.1 and 1.1.0 do not work with cython 0.28, see https://github.com/scipy/scipy/pull/8581 upstream, and indeed the error persists with scipy 1.0.0 but disappears with scipy 1.1.0.

By the way, this only happens to me with python3, I do not have this issue at all with python2.
Comment 1 Scott Alfter 2019-05-02 18:44:02 UTC
Ran into the same problem just now...found this fix, which I'm testing:

https://github.com/scipy/scipy/commit/b00aa149ef44baf6f0d215d2bd7062b5a04ff72c.patch

You'll need to remove the last change (to tools/ci/appveyor/requirements.txt) to patch the downloaded tarball.  Save it to /etc/portage/patches/sci-libs/scipy-0.19.1/scipy-0.19.1-cython-fix.patch.
Comment 2 Scott Alfter 2019-05-02 19:29:55 UTC
...and the fix works.  Save it as described above and rebuild scipy.
Comment 3 Marc Vinyals 2020-01-30 04:35:24 UTC
The affected versions are no longer in tree; feel free to close this.