LukeHan 의 잡다한 기술 블로그

Python3.9 Install in ubuntu 18.04 or HamoniKR SUN 본문

개발/Python

Python3.9 Install in ubuntu 18.04 or HamoniKR SUN

LukeHan1128 2022. 3. 6. 20:00
반응형

개발환경 구축을 위해 하모니카 SUN 버전에서 Python3.9 버전 설치가 필요했다.

 

하모니카 SUN 버전은 ubuntu 18.04 를 베이스로 제작된 OS 이니 ubuntu 18.04 에서 Python3.9 를 설치하는 경우 해당 문서를 참고하면 된다.

 

 

sudo add-apt-repository ppa:deadsnakes/ppa

Terminal 을 연 뒤 (Ctrl + Alt + T) command line 에서 위와 같이 명령어를 입력한다.

명령어를 입력하면 아래와 같이 출력될 것이다.

 

 

/usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.26.3) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
다음 PPA를 추가하게 됩니다:
 This PPA contains more recent Python versions packaged for Ubuntu.

Disclaimer: there's no guarantee of timely updates in case of security problems or other issues. If you want to use them in a security-or-otherwise-critical environment (say, on a production server), you do so at your own risk.

Update Note
===========
Please use this repository instead of ppa:fkrull/deadsnakes.

Reporting Issues
================

Issues can be reported in the master issue tracker at:
https://github.com/deadsnakes/issues/issues

Supported Ubuntu and Python Versions
====================================

- Ubuntu 18.04 (bionic) Python2.3 - Python 2.6, Python 3.1 - Python 3.5, Python3.7 - Python3.11
- Ubuntu 20.04 (focal) Python3.5 - Python3.7, Python3.9 - Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal) are not provided by deadsnakes as upstream ubuntu provides those packages.
- Note: for focal, older python versions require libssl1.0.x so they are not currently built

The packages may also work on other versions of Ubuntu or Debian, but that is not tested or supported.

Packages
========

The packages provided here are loosely based on the debian upstream packages with some modifications to make them more usable as non-default pythons and on ubuntu.  As such, the packages follow debian's patterns and often do not include a full python distribution with just `apt install python#.#`.  Here is a list of packages that may be useful along with the default install:

- `python#.#-dev`: includes development headers for building C extensions
- `python#.#-venv`: provides the standard library `venv` module
- `python#.#-distutils`: provides the standard library `distutils` module
- `python#.#-lib2to3`: provides the `2to3-#.#` utility as well as the standard library `lib2to3` module
- `python#.#-gdbm`: provides the standard library `dbm.gnu` module
- `python#.#-tk`: provides the standard library `tkinter` module

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 더 많은 정보: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Enter키를 눌러서 계속하시거나 Ctrl+C 를 눌러서 취소하세요

Executing: /tmp/apt-key-gpghome.j1QO8LFd3C/gpg.1.sh --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
gpg: keyserver receive failed: General error

아마 위와 같이 gpg keyserver 에러가 발생할 것이다.

에러를 확인 하였다면 아래와 같이 입력하여 apt-key 를 추가한다.

 

 

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv F23C5A6CF475977595C89F51BA6932366A755776

처음 입력한 명령어에서 제공하는 url 은 443 prot 를 사용하지만 현재 사용이 되지 않는 것으로 판단된다.

대신 80 port 가 사용 가능하니 해당 port 로 url 정보를 변경하여 apt-key 를 추가한다.

 

 

Executing: /tmp/apt-key-gpghome.jdNk4GjA5B/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv F23C5A6CF475977595C89F51BA6932366A755776
gpg: key BA6932366A755776: public key "Launchpad PPA for deadsnakes" imported
gpg: Total number processed: 1
gpg:               imported: 1

위와 같이 출력 된다면 이상 없이 추가된 것이다.

 

 

sudo apt-get update

추가 완료 하였다면 위와 같이 입력하여 추가사항을 반영한다.

 

 

lukehan@lukehan:~$ sudo apt-get install python3.9
python3.9            python3.9-distutils  python3.9-full       python3.9-lib2to3    python3.9-tk-dbg
python3.9-dbg        python3.9-doc        python3.9-gdbm       python3.9-minimal    python3.9-venv
python3.9-dev        python3.9-examples   python3.9-gdbm-dbg   python3.9-tk

업데이트가 반영되었다면 위와 같이 python3.9 관련 패키지를 확인할 수 있다.

 

반응형
Comments