Django/인프라

[AWS Lightsail] 비공식 PPA를 통한 파이썬 설치하기 (3.12)

Jong_seoung 2024. 8. 6. 10:46
반응형

우분투 22.04 LTS는 python 명령을 지원하지 않고, python3만을 사용한다.

python 명령이 python3로 동작하도록 변경할 수 있다. 

ubuntu@django-instance:~$ python3 --version
Python 3.10.12

ubuntu@django-instance:~$ python --version
Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3
  
ubuntu@django-instance:~$ sudo add-apt-repository ppa:deadsnakes/ppa

ubuntu@django-instance:~$ sudo apt install -y python3.12 python3.12-venv

ubuntu@django-instance:~$ python3.12 --version
Python 3.12.4

ubuntu@django-instance:~$ which python3.12
/usr/bin/python3.12

ubuntu@django-instance:~$ python --version
Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3
  
ubuntu@django-instance:~$ curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.12
Collecting pip

ubuntu@django-instance:~$ python3.12 -m pip --version
pip 24.2 from /usr/local/lib/python3.12/dist-packages/pip (python 3.12)
반응형