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] No module named '_sysconfigdata_d_linux_x86_64-linux-gnu'

See original GitHub issue

setuptools version

setuptools==60.0.0

Python version

Python 3.9

OS

Ubuntu 20.04

Additional environment information

Can reproduce in Docker or with deadsnakes action.

Description

Today, 3.9 deadsnakes debug builds on GitHub Actions for pybind11 started failing with ModuleNotFoundError: No module named '_sysconfigdata_d_linux_x86_64-linux-gnu'. Setting SETUPTOOLS_USE_DISTUTILS=stdlib` fixes it.

Logs: https://github.com/pybind/pybind11/runs/4583094186?check_suite_focus=true

Original report: https://github.com/deadsnakes/issues/issues/188

Expected behavior

It should be possible to use setuptools and sysconfig on Python 3.9 debug builds! 😃

How to Reproduce

deadsnakes/action@v2.1.1 on ubuntu-latest, GHA, followed by the final line below. Or it can be reproduced in Docker. Here is a MWE:

$ docker run --rm -it ubuntu:20.04
# apt update && apt install software-properties-common -y
# add-apt-repository ppa:deadsnakes/ppa && apt update && apt install -y python3.9-dev python3.9-dbg python3.9-venv python3.9-distutils
# python3.9-dbg -m venv .venv
# ./.venv/bin/python -m pip install -U pip setuptools wheel
# ./.venv/bin/python -c "import setuptools; from distutils import sysconfig as s; s.get_config_var('LDVERSION')"

Output

Traceback (most recent call last):
  File "/.venv/lib/python3.9/site-packages/setuptools/_distutils/sysconfig.py", line 488, in _init_posix
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata_d_linux_x86_64-linux-gnu'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/.venv/lib/python3.9/site-packages/setuptools/_distutils/sysconfig.py", line 601, in get_config_var
    return get_config_vars().get(name)
  File "/.venv/lib/python3.9/site-packages/setuptools/_distutils/sysconfig.py", line 532, in get_config_vars
    func()
  File "/.venv/lib/python3.9/site-packages/setuptools/_distutils/sysconfig.py", line 491, in _init_posix
    _temp = __import__(
ModuleNotFoundError: No module named '_sysconfigdata'

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:24 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
ryancheleycommented, Jul 27, 2022

I had this same issue and this StackOverflow answer was able to resolve it for me

1reaction
jaracocommented, Dec 30, 2021

Creating a debug symlink seems to work around the issue.

root@eda1978d024a:/# ln -s _sysconfigdata_d_x86_64-linux-gnu.py /usr/lib/python3.9/_sysconfigdata_d_linux_x86_64-linux-gnu.py
root@eda1978d024a:/# ./.venv/bin/python -c "from distutils import sysconfig as s; s.get_config_var('LDVERSION')" && echo worked
worked
Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named '_sysconfigdata__linux_x86_64-linux-gnu ...
msg347765 ‑ (view) Author: Luis Alejandro Martínez Faneyth (luisalejandro) Date: 2019‑07... msg347788 ‑ (view) Author: Christian Heimes (christian.heimes) * Date: 2019‑07... msg348017 ‑ (view) Author:...
Read more >
Conda ERROR _sysconfigdata_x86_64_conda_linux_gnu
I have one error: ModuleNotFoundError: No module named '_sysconfigdata_x86_64_conda_linux_gnu' Using comand: pip3 install --editable .
Read more >
Bug #1115466 “_sysconfigdata_nd.py missing in /usr/lib ...
The file is present on Debian. This is causing virtualenv to fail, and probably other modules too.
Read more >
Impossibility to test for coverage in extensions - Development
This bug is not critical but it is annoying and eventually will raise another bug. ... No module named '_sysconfigdata_m_linux_x86_64-linux-gnu' ERROR: Job ...
Read more >
ModuleNotFoundError: No module named 'cryosparc_compute'
Hello, I am having the following problem when trying to start cryosparc after uploading to version 4.0.3 from version 4.0.1. cryosparc ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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