Skip to content

undefined symbol: Py_SET_TYPE #193

@grisuthedragon

Description

@grisuthedragon

After installing slycot using pip I got the following error, when I am trying to import it:

Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import slycot
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/env/lib/python3.8/site-packages/slycot/__init__.py", line 16, in <module>
    from .analysis import ab01nd, ab05md, ab05nd, ab07nd, ab08nd, ab08nz
  File "/home/user/env/lib/python3.8/site-packages/slycot/analysis.py", line 22, in <module>
    from . import _wrapper
ImportError: /home/user/env/lib/python3.8/site-packages/slycot/_wrapper.cpython-38-x86_64-linux-gnu.so: undefined symbol: Py_SET_TYPE

I am using Ubuntu 20.04 with Python 3.8.10 and created a new virtual environment for it:

$ virtualenv env 
$ source ./env/bin/activate
$ pip install --no-cache-dir slycot
Collecting slycot
  Downloading slycot-0.5.3.tar.gz (3.0 MB)
     |████████████████████████████████| 3.0 MB 6.3 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting numpy
  Downloading numpy-1.24.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     |████████████████████████████████| 17.3 MB 100.9 MB/s 
Building wheels for collected packages: slycot
  Building wheel for slycot (PEP 517) ... done
  Created wheel for slycot: filename=slycot-0.5.3-cp38-cp38-linux_x86_64.whl size=1987476 sha256=53f161973476b615f3a07211877910eb89ad85d66428fc31d8b6e980a21a766a
  Stored in directory: /tmp/pip-ephem-wheel-cache-e2j324rb/wheels/f7/b1/ef/08bc53cdb0fe98fa3c4067f1e674ebc4fd32a965544b558450
Successfully built slycot
Installing collected packages: numpy, slycot
Successfully installed numpy-1.24.2 slycot-0.5.3
$ python -c 'import slycot'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/env/lib/python3.8/site-packages/slycot/__init__.py", line 16, in <module>
    from .analysis import ab01nd, ab05md, ab05nd, ab07nd, ab08nd, ab08nz
  File "/home/user/env/lib/python3.8/site-packages/slycot/analysis.py", line 22, in <module>
    from . import _wrapper
ImportError: /home/user/env/lib/python3.8/site-packages/slycot/_wrapper.cpython-38-x86_64-linux-gnu.so: undefined symbol: Py_SET_TYPE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions