Skip to content

Extension library loading only works on Python 3.8 #2

@tinyAdapter

Description

@tinyAdapter

I found that the sample code only works in Python 3.8 but not other versions.

When I compile and link with others like 3.7, 3.9 and 3.10, the main program will crash with the error

terminate called after throwing an instance of 'pybind11::error_already_set'
  what():  ImportError: /home/user/anaconda3/envs/customloader/lib/python3.10/lib-dynload/unicodedata.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyUnicode_Ready

At:
  /home/user/anaconda3/envs/customloader/lib/python3.10/site-packages/regex/_regex_core.py(18): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(883): exec_module
  <frozen importlib._bootstrap>(703): _load_unlocked
  <frozen importlib._bootstrap>(1006): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1027): _find_and_load
  /home/user/anaconda3/envs/customloader/lib/python3.10/site-packages/regex/regex.py(421): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(883): exec_module
  <frozen importlib._bootstrap>(703): _load_unlocked
  <frozen importlib._bootstrap>(1006): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1027): _find_and_load
  /home/user/anaconda3/envs/customloader/lib/python3.10/site-packages/regex/__init__.py(1): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(883): exec_module
  <frozen importlib._bootstrap>(703): _load_unlocked
  <frozen importlib._bootstrap>(1006): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1027): _find_and_load
  <string>(2): <module>

Aborted (core dumped)

It seems that the effort on supporting C extensions does not work at all. But with Python 3.8 the main program runs normally.

I'm not familiar with CPython, so I have no idea why this could happen. Could you please share some thoughts on this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions