
저는 LTS 릴리스(즉, 최신 패키지 포함)를 사용하지 않기를 원하기 때문에 Ubuntu 21.04로 업그레이드했습니다. 저는 기본 Python 3.9를 사용하여 새로운 코드베이스를 즐겁게 작업해 왔습니다.
하지만 Python 3.6에서 실행되는 이전 프로젝트의 경우 3.9 이전 버전도 설치하고 싶습니다(버전 3.9 문제와 관련된 패키징 문제가 발생했습니다)https://github.com/hzdg/django-enumfields/commit/8a54ab6ca1a406b4f736b1d8a1daff49431a1c5c그러나 현재 3.6에서 실행되는 코드베이스에 대해 3.9 특정 수정 사항을 적용하는 것보다 필요에 따라 내 virtualenv에 3.6 또는 3.7을 사용할 수 있는 것이 더 좋습니다.
deadsnakes ppa를 설치 sudo add-apt-repository ppa:deadsnakes/ppa
하고 업데이트를 완료했습니다. 그런데 이전 Python 버전을 설치하려고 하면 종속성 문제가 발생합니다(아마도 초점 패키지이기 때문일 것입니다).
sudo apt-get install python3.7
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python3.7 : Depends: libpython3.7-stdlib (= 3.7.12-1+focal1) but it is not installable
E: Unable to correct problems, you have held broken packages.
답변1
직접 컴파일해야 합니다. 사용:
sudo apt-get install libssl-dev openssl
wget https://www.python.org/ftp/python/<version>/Python-<version>.tgz
tar xzvf Python-<version>.tgz
cd Python-<version>
./configure
make
while은 <version>
유효한 Python 버전입니다(예: 3.7.0
.