Python 3.9 설치 시 설치 오류

Python 3.9 설치 시 설치 오류

나는 antiX 19.3에 Python 3.9를 설치하려고 했습니다. 내가 따라온 가이드는 다음과 같습니다.여기. 내 설치의 차이점은 다음과 같습니다.

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

다음 명령을 제외하고 초기 프로세스는 원활하게 진행되었습니다.

sudo make install

로그 파일이 붙여넣어졌습니다.제로박스(크기 제한에 대해 Pastebin에게 감사드립니다!) https://www.i1984.cz/paste/?ef63821f80bdba6f#tViAQ43HnOT6nqMq6V9rFclUig+/lVR/m+SDolo3nQI=

로그의 마지막 부분:

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
----------------

답변1

Debian 기반 시스템에서 Python을 빌드하려면 다음 패키지를 설치해야 합니다:

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

libreadline-dev의 대안:

sudo apt install libedit-dev

일반적인 빌드 문제: 필수 구성 요소

관련 정보