Error when using checkinstall to create Python 3.12 installer on Debian 11

175 Views Asked by At

I am using checkinstall 1.6.3 to create a .deb installer for Python 3.12 on Debian 11.

I used this description as an outline for doing it and had it working in the past for Python 3.11 on the same system: How to Install python3.8 using checkinstall on debian 10?

I downloaded and unpacked the tarball from python.org, installed dependencies, and ran the following commands:

./configure --enable-optimizations --enable-shared --prefix=/usr
make -j $(nproc)
make -n altinstall > make_altinstall.sh
chmod +x make_altinstall.sh
sudo checkinstall -D ./make_altinstall.sh

checkinstall creates a lot of output, so I only include from the point where the error appears:

ERROR: Exception:
Traceback (most recent call last):
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/cli/req_command.py", line 248, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/commands/install.py", line 324, in run
    session = self.get_default_session(options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/cli/req_command.py", line 98, in get_default_session
    self._session = self.enter_context(self._build_session(options))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/cli/req_command.py", line 125, in _build_session
    session = PipSession(
              ^^^^^^^^^^^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/network/session.py", line 342, in __init__
    self.headers["User-Agent"] = user_agent()
                                 ^^^^^^^^^^^^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/network/session.py", line 175, in user_agent
    setuptools_dist = get_default_environment().get_distribution("setuptools")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/metadata/importlib/_envs.py", line 188, in get_distribution
    return next(matches, None)
           ^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/metadata/importlib/_envs.py", line 183, in <genexpr>
    matches = (
              ^
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/metadata/base.py", line 612, in iter_all_distributions
    for dist in self._iter_distributions():
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/metadata/importlib/_envs.py", line 176, in _iter_distributions
    for dist in finder.find_eggs(location):
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/metadata/importlib/_envs.py", line 144, in find_eggs
    yield from self._find_eggs_in_dir(location)
  File "/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl/pip/_internal/metadata/importlib/_envs.py", line 115, in _find_eggs_in_dir
    with os.scandir(location) as it:
         ^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ''
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/thomas/Downloads/Python-3.12.0/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
             ^^^^^^^^^^^^^^^^^
  File "/home/thomas/Downloads/Python-3.12.0/Lib/ensurepip/__init__.py", line 284, in _main
    return _bootstrap(
           ^^^^^^^^^^^
  File "/home/thomas/Downloads/Python-3.12.0/Lib/ensurepip/__init__.py", line 200, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thomas/Downloads/Python-3.12.0/Lib/ensurepip/__init__.py", line 101, in _run_pip
    return subprocess.run(cmd, check=True).returncode
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thomas/Downloads/Python-3.12.0/Lib/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/thomas/Downloads/Python-3.12.0/python', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmpklvy9437/pip-23.2.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmpklvy9437\', \'--root\', \'/\', \'--upgrade\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 2.

****  Installation failed. Aborting package creation.

Cleaning up...OK

Bye.

It seems like the error may have something to do with pip or setuptools. Any tips on how to fix this issue are much appreciated.

0

There are 0 best solutions below