1

I've been trying to install python 3.9 on antiX 19.3.. The guide i've been following is from here. The discrepancies i've installed are the following:

sudo apt-get install build-essential 
sudo apt-get install libsqlite3-dev
sudo apt-get install libbz2-dev

The initial procedure went smooth except this command:

sudo make install

Log file is pasted on ZeroBin (thanks to pastebin for the size limit!) https://www.i1984.cz/paste/?ef63821f80bdba6f#tViAQ43HnOT6nqMq6V9rFclUig+/lVR/m+SDolo3nQI=

The last part of the log:

rm -f /usr/local/share/man/man1/python3.1
(cd /usr/local/share/man/man1; ln -s python3.9.1 python3.1)
if test "xupgrade" != "xno"  ; then \
    case upgrade in \
        upgrade) ensurepip="--upgrade" ;; \
        install|*) ensurepip="" ;; \
    esac; \
     ./python -E -m ensurepip \
        $ensurepip --root=/ ; \
fi
Traceback (most recent call last):
  File "<frozen zipimport>", line 520, in _get_decompress_func
ModuleNotFoundError: No module named 'zlib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen zipimport>", line 568, in _get_data
  File "<frozen zipimport>", line 523, in _get_decompress_func
zipimport.ZipImportError: can't decompress data; zlib not available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "/home/alex/Downloads/Python-3.9.0/Lib/runpy.py", line 206, in run_module
    mod_name, mod_spec, code = _get_module_details(mod_name)
  File "/home/alex/Downloads/Python-3.9.0/Lib/runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/home/alex/Downloads/Python-3.9.0/Lib/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "<frozen zipimport>", line 241, in load_module
  File "<frozen zipimport>", line 709, in _get_module_code
  File "<frozen zipimport>", line 570, in _get_data
zipimport.ZipImportError: can't decompress data; zlib not available
Traceback (most recent call last):
  File "/home/alex/Downloads/Python-3.9.0/Lib/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/alex/Downloads/Python-3.9.0/Lib/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/alex/Downloads/Python-3.9.0/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/home/alex/Downloads/Python-3.9.0/Lib/ensurepip/__init__.py", line 210, in _main
    return _bootstrap(
  File "/home/alex/Downloads/Python-3.9.0/Lib/ensurepip/__init__.py", line 129, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/home/alex/Downloads/Python-3.9.0/Lib/ensurepip/__init__.py", line 38, in _run_pip
    return subprocess.run([sys.executable, "-c", code], check=True).returncode
  File "/home/alex/Downloads/Python-3.9.0/Lib/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/alex/Downloads/Python-3.9.0/python', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmphhr5gs_j/setuptools-49.2.1-py3-none-any.whl\', \'/tmp/tmphhr5gs_j/pip-20.2.3-py2.py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmphhr5gs_j\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
make: *** [Makefile:1254: install] Error 1
make exited with status code 2

Mon Nov 30 15:43:51 2020
----------------
2
  • 2
    It looks as if you don't have zlib installed.
    – Kusalananda
    Nov 30 '20 at 7:41
  • In addition to the above, pay attention to what the errors say isn't available if the build continues to fail. Nov 30 '20 at 8:15
1

To build python on debian based system you need to install the following packages:

sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

Alternative of libreadline-dev:

sudo apt install libedit-dev

Common build problems: Prerequisites

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.