'subprocess.CalledProcessError: Command ERROR

i'am on debian 10 OS and i'am trying to install python 3.9 (tried also 3.6 to 3.9), i need 3.6 because my apps working with f"", can't manage to do it in another way and i don't want to. So i execute does commands:

wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz

tar -xf Python-3.9.1.tgz

cd Python-3.9.1

./configure --enable-optimizations

make -j 2

and the problem happens there when i try to install python in binairies

sudo make altinstall

i got this error:

    running install_scripts
copying build/scripts-3.9/idle3.9 -> /usr/local/bin
copying build/scripts-3.9/pydoc3.9 -> /usr/local/bin
copying build/scripts-3.9/2to3-3.9 -> /usr/local/bin
changing mode of /usr/local/bin/idle3.9 to 755
changing mode of /usr/local/bin/pydoc3.9 to 755
changing mode of /usr/local/bin/2to3-3.9 to 755
rm /usr/local/lib/python3.9/lib-dynload/_sysconfigdata__linux_x86_64-linux-gnu.py
rm -r /usr/local/lib/python3.9/lib-dynload/__pycache__
/usr/bin/install -c -m 644 ./Misc/python.man \
    /usr/local/share/man/man1/python3.9.1
if test "xupgrade" != "xno"  ; then \
    case upgrade in \
        upgrade) ensurepip="--altinstall --upgrade" ;; \
        install|*) ensurepip="--altinstall" ;; \
    esac; \
     ./python -E -m ensurepip \
        $ensurepip --root=/ ; \
fi
ERROR: Exception:
Traceback (most recent call last):
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 272, in run
    session = self.get_default_session(options)
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_internal/cli/req_command.py", line 80, in get_default_session
    self._session = self.enter_context(self._build_session(options))
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_internal/cli/req_command.py", line 90, in _build_session
    session = PipSession(
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_internal/network/session.py", line 249, in __init__
    self.headers["User-Agent"] = user_agent()
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_internal/network/session.py", line 132, in user_agent
    zip(["name", "version", "id"], distro.linux_distribution()),
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 125, in linux_distribution
    return _distro.linux_distribution(full_distribution_name)
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 681, in linux_distribution
    self.version(),
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 741, in version
    self.lsb_release_attr('release'),
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 903, in lsb_release_attr
    return self._lsb_release_info.get(attribute, '')
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 556, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)
  File "/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 1014, in _lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)
  File "/home/tarek/Python-3.9.1/Lib/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/tarek/Python-3.9.1/Lib/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('lsb_release', '-a')' died with <Signals.SIGABRT: 6>.
Traceback (most recent call last):
  File "/home/tarek/Python-3.9.1/Lib/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/tarek/Python-3.9.1/Lib/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/tarek/Python-3.9.1/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/home/tarek/Python-3.9.1/Lib/ensurepip/__init__.py", line 210, in _main
    return _bootstrap(
  File "/home/tarek/Python-3.9.1/Lib/ensurepip/__init__.py", line 129, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/home/tarek/Python-3.9.1/Lib/ensurepip/__init__.py", line 38, in _run_pip
    return subprocess.run([sys.executable, "-c", code], check=True).returncode
  File "/home/tarek/Python-3.9.1/Lib/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/tarek/Python-3.9.1/python', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmptbfwxyt5/setuptools-49.2.1-py3-none-any.whl\', \'/tmp/tmptbfwxyt5/pip-20.2.3-py2.py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmptbfwxyt5\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 2.
make: *** [Makefile:1265: altinstall] Error 1

Any solution please, got tired from it, and i can't reinstall the system because it's on the server and it would take so much time.

Ask me if you need more information, i'am here to help and get help so !



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source