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.

BUG: On Py3.10 importing `scipy.x` fails

See original GitHub issue

Describe your issue.

Importing scipy.signal under Py3.10 (in a venv) fails with this message (on Py3.9.4 and older it works):

$ python3
Python 3.10.0a6 (default, Mar  2 2021, 02:01:08) [GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.signal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/vgl310/lib/python3.10/site-packages/scipy/signal/__init__.py", line 302, in <module>
    from .filter_design import *
  File "~/vgl310/lib/python3.10/site-packages/scipy/signal/filter_design.py", line 16, in <module>
    from scipy import special, optimize, fft as sp_fft
  File "~/vgl310/lib/python3.10/site-packages/scipy/optimize/__init__.py", line 421, in <module>
    from ._shgo import shgo
  File "~/vgl310/lib/python3.10/site-packages/scipy/optimize/_shgo.py", line 9, in <module>
    from scipy import spatial
  File "~/vgl310/lib/python3.10/site-packages/scipy/spatial/__init__.py", line 107, in <module>
    from . import distance, transform
  File "/home/ullix/geigerlog/vgl310/lib/python3.10/site-packages/scipy/spatial/transform/__init__.py", line 19, in <module>
    from .rotation import Rotation, Slerp
ImportError: /home/ullix/geigerlog/vgl310/lib/python3.10/site-packages/scipy/spatial/transform/rotation.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send

The latest version of scipy is installed:

$ python3 -m pip install -U scipy
Requirement already satisfied: scipy in ~/vgl310/lib/python3.10/site-packages (1.6.1)
Requirement already satisfied: numpy>=1.16.5 in ~/vgl310/lib/python3.10/site-packages (from scipy) (1.21.2)

Reproducing Code Example

-

Error message

-

SciPy/NumPy/Python version information

import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info) 1.6.1 1.21.2 sys.version_info(major=3, minor=10, micro=0, releaselevel='alpha', serial=6)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
tupuicommented, Nov 2, 2021

pip install git+https://github.com/scipy/scipy solves the issue for me. A new release would be great 👍

Note that not having a release of scipy on pypi makes it hard for downstream projects to test with 3.10 …

A release is in the making (cf the branch 1.7.2 and #14567). It just takes time out of our limited resources.

0reactions
rgommerscommented, Nov 6, 2021

1.7.2 is released, closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BUG: Cannot install SciPy 1.9.3 in Python 3.10 in macOS
mesonpy-flu011q5/build']' returned non-zero exit status 1. [end of output] note: This error originates from a subprocess, and is likely not a ...
Read more >
SciPy 1.8.0 Release Notes — SciPy v1.9.3 Manual
Our development attention will now shift to bug-fix releases on the 1.8.x branch, ... #15316: BUG: Failed to install scipy 1.7.x with pypy...
Read more >
1926090 – python-tabulate fails to build with Python 3.10
1926090 – python-tabulate fails to build with Python 3.10: ImportError: cannot import name 'Iterable' from 'collections' Summary: python-tabulate fails to ...
Read more >
The 10 Most Common Mistakes That Python Developers Make
Common Mistake #9: Failing to address differences between Python 2 and Python 3. Consider the following file foo.py : import sys def bar(i):...
Read more >
What's New In Python 3.8 — Python 3.11.1 documentation
On Unix, when Python is built in debug mode, import now also looks for C ... to python3-config --libs (without --embed ) if...
Read more >

github_iconTop Related Medium Post

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