question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sklearn/utils/_cython_blas.pyx fails to cythonize if scipy is not installed in the env

See original GitHub issue

Now that we don’t cythonize before creating the sdist, using the sdist fails to properly install the package if the freshly created environment doesn’t include scipy.

pip install scikit-learnxxx.tar.gz on an environment which has numpy and cython, will fail while trying to cythonize sklearn/utils/_cython_blas.pyx.

Example error:

 sklearn/utils/_cython_blas.pyx:203:40: Converting to Python object not allowed without gil
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          if floating is float:
              sgemm(&ta_, &tb_, &m, &n, &k, &alpha, A,
                    &lda, B, &ldb, &beta, C, &ldc)
          else:
              dgemm(&ta_, &tb_, &m, &n, &k, &alpha, A,
                    &lda, B, &ldb, &beta, C, &ldc)
                                            ^
  ------------------------------------------------------------
  
  sklearn/utils/_cython_blas.pyx:203:43: Converting to Python object not allowed without gil

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
adrinjalalicommented, Nov 11, 2019

yeah I’m already adding to the maintainers.rst as I go. I’ll submit a separate PR after the release 😃

0reactions
NicolasHugcommented, Nov 11, 2019

BTW @adrinjalali whatever issues you’re going through are a great opportunity to document the subtleties of the releasing process… 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

build scipy error cythonize failed - python - Stack Overflow
For me, this problem occurred due to incompatible python + pandas versions due to incorrect environment configurations despite using Anaconda.
Read more >
build failure when cython files are not "cythonized" beforehand.
c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation. error: command 'gcc' failed with exit...
Read more >
Adding Cython to SciPy — SciPy v1.7.0 Manual
Cython is an optimising static compiler for both the Python programming language and the extended Cython programming language (based on Pyrex). It makes...
Read more >
Source Files and Compilation - Cython's Documentation
Note that if you are not relying on cythonize or setuptools, you will not ... running python setup.py install is to create a...
Read more >
High performance Python: Compiling Cython code
Typical usage of Cython will include the writing of Python and Cython code ... of Cython pyximport.install() from fib import fib # This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found