scipy: Cannot build from source

Want to build from source to work on adding a missing distribution (Landau distribution). Following the steps from here. Using the pip+venv workflow. Already cloned the repo and created the virtual environment, run python -m pip install numpy pytest cython pythran pybind11 meson ninja pydevtool rich-click successfully. I am getting an error when running python3 dev.py build, specifically meson.build:1:0: ERROR: Cython compiler 'cython' cannot compile programs. If I look into the log I find:

Compiler stderr:
...
  File "/home/me/.venvs/scipy-dev/lib/python3.10/site-packages/pythran/optimizations/pattern_transform.py", line 346, in <module>
    getattr(PatternTransform, attr_name) + (known_pattern,))
AttributeError: type object 'PatternTransform' has no attribute 'typePatterns'. Did you mean: 'CallPatterns'?

How can I fix this to build the development version of scipy?

OS: Ubuntu 22.04. Python: 3.10.6

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 35 (35 by maintainers)

Commits related to this issue

Most upvoted comments

That being said, Pythran 0.13.1 has a lot of performance improvement, you should give it a chance 😉

Definitely. We are automatically using that on SciPy main, and will use it in SciPy 1.11.0 which is planned for early June. In conda-forge it will also be used after rebuilds. On PyPI we can’t change metadata post-release though, so there’s we’re at <0.13.

Got it, I’ll do a pythran 0.12.1 branch with the gast patch, that seems to be the easiest way.

Or turn off Pythran parts maybe through SCIPY_USE_PYTHRAN=0 until things are sorted out?

For SciPy proper, I can definitely build from source with gast 0.5.3 and it definitely fails reproducibly with 0.5.4.

This is showing up on our CI too so is not an issue unique to you. Note before working on your new feature it is worth proposing it on the mailing list first so as to not waste effort.