<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">I always (since about three days) get this error when install the package.</p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pip install scipy"><pre class="notranslate"><span class="pl-s1">pip</span> <span class="pl-s1">install</span> <span class="pl-s1">scipy</span></pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Using cached scipy-1.10.1.tar.gz (42.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─&gt; [16 lines of output]
      The Meson build system
      Version: 1.1.0
      Source dir: /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336
      Build dir: /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336/.mesonpy-i8u5z56g/build
      Build type: native build
      Project name: SciPy
      Project version: 1.10.1
      C compiler for the host machine: cc (gcc 12.2.1 &quot;cc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924&quot;)
      C linker for the host machine: cc ld.bfd 2.39
      C++ compiler for the host machine: c++ (gcc 12.2.1 &quot;c++ (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924&quot;)
      C++ linker for the host machine: c++ ld.bfd 2.39
      
      ../../meson.build:1:0: ERROR: Cython compiler 'cython' cannot compile programs
      
      A full log can be found at /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336/.mesonpy-i8u5z56g/build/meson-logs/meson-log.txt
      + meson setup --prefix=/usr/local /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336 /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336/.mesonpy-i8u5z56g/build --native-file=/tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed"><pre class="notranslate">Using cached scipy-1.10.1.tar.gz (42.4 MB)
  Installing build dependencies ... <span class="pl-k">done</span>
  Getting requirements to build wheel ... <span class="pl-k">done</span>
  Installing backend dependencies ... <span class="pl-k">done</span>
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ <span class="pl-c1">exit</span> code: 1
  ╰─<span class="pl-k">&gt;</span> [16 lines of output]
      The Meson build system
      Version: 1.1.0
      Source dir: /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336
      Build dir: /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336/.mesonpy-i8u5z56g/build
      Build type: native build
      Project name: SciPy
      Project version: 1.10.1
      C compiler <span class="pl-k">for</span> the host machine: cc (gcc 12.2.1 <span class="pl-s"><span class="pl-pds">"</span>cc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924<span class="pl-pds">"</span></span>)
      C linker <span class="pl-k">for</span> the host machine: cc ld.bfd 2.39
      C++ compiler <span class="pl-k">for</span> the host machine: c++ (gcc 12.2.1 <span class="pl-s"><span class="pl-pds">"</span>c++ (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924<span class="pl-pds">"</span></span>)
      C++ linker <span class="pl-k">for</span> the host machine: c++ ld.bfd 2.39
      
      ../../meson.build:1:0: ERROR: Cython compiler <span class="pl-s"><span class="pl-pds">'</span>cython<span class="pl-pds">'</span></span> cannot compile programs
      
      A full log can be found at /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336/.mesonpy-i8u5z56g/build/meson-logs/meson-log.txt
      + meson setup --prefix=/usr/local /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336 /tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336/.mesonpy-i8u5z56g/build --native-file=/tmp/pip-install-1_lvv1l1/scipy_49f6f8770d974237958632829d776336/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version and system information</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="scipy-1.10.1"><pre class="notranslate">scipy-1.10.1</pre></div>
<p dir="auto">Want to build from source to work on adding a missing distribution (Landau distribution). Following the steps from <a href="https://scipy.github.io/devdocs/dev/dev_quickstart.html" rel="nofollow">here</a>. Using the <em>pip+venv</em> workflow. Already cloned the repo and created the virtual environment, run <code class="notranslate">python -m pip install numpy pytest cython pythran pybind11 meson ninja pydevtool rich-click</code> successfully. I am getting an error when running <code class="notranslate">python3 dev.py build</code>, specifically <code class="notranslate">meson.build:1:0: ERROR: Cython compiler 'cython' cannot compile programs</code>. If I look into the log I find:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Compiler stderr:
...
  File &quot;/home/me/.venvs/scipy-dev/lib/python3.10/site-packages/pythran/optimizations/pattern_transform.py&quot;, line 346, in &lt;module&gt;
    getattr(PatternTransform, attr_name) + (known_pattern,))
AttributeError: type object 'PatternTransform' has no attribute 'typePatterns'. Did you mean: 'CallPatterns'?"><pre class="notranslate"><code class="notranslate">Compiler stderr:
...
  File "/home/me/.venvs/scipy-dev/lib/python3.10/site-packages/pythran/optimizations/pattern_transform.py", line 346, in &lt;module&gt;
    getattr(PatternTransform, attr_name) + (known_pattern,))
AttributeError: type object 'PatternTransform' has no attribute 'typePatterns'. Did you mean: 'CallPatterns'?
</code></pre></div>
<p dir="auto">How can I fix this to build the development version of scipy?</p>
<p dir="auto">OS: Ubuntu 22.04.<br>
Python: 3.10.6</p>