개인 저장용 블로그

RabbitMQ Tutorials - Python 환경구성 (2) 본문

오픈소스/RabbitMQ

RabbitMQ Tutorials - Python 환경구성 (2)

우엉잇 2022. 4. 4. 10:05
이번 목차는 Python을 이용하여 RabbitMQ를 테스트 하기 전 환경 구성에 대한 내용입니다. 

 

- Python3 설치 버전 확인

mwno@master:~# sudo apt-get install python3
 
Reading package lists... Done
Building dependency tree      
Reading state information... Done
python3 is already the newest version (3.8.2-0ubuntu2).
python3 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 98 not upgraded.
root@master:~#
 
root@master:~# python3 --version
Python 3.8.10

 

 

- PIKA 라이브러리 설치

 

Python으로 메시지큐를 테스트 하기 위해서는 Pika 사용하는 권장 합니다.

mwno@master:~# sudo apt install python3-pip
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following additional packages will be installed:
.
.
 
 
mwno@master:~# sudo pip install pika
Collecting pika
  Downloading pika-1.2.0-py2.py3-none-any.whl (154 kB)
     |████████████████████████████████| 154 kB 1.4 MB/s
Installing collected packages: pika
Successfully installed pika-1.2.0
 
.
(아래 명령어 입력 따로 나온느 내용이 없다면 정상적으로 설치 )
root@master:~# python3 -c 'import pika'
root@master:~#

 

* 참고 우분트 20.04 update 404  Not Found [IP: 91.189.91.123 80] 이슈가 발생하면, /etc/apt/sources.list 파일을 아래와 같이 변경

 

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ hirsute main restricted
 
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ca.archive.ubuntu.com/ubuntu/ hirsute universe
deb http://ca.archive.ubuntu.com/ubuntu/ hirsute-updates universe
 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ca.archive.ubuntu.com/ubuntu/ hirsute multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse
 
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ca.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse
 
deb http://security.ubuntu.com/ubuntu hirsute-security main restricted
deb http://security.ubuntu.com/ubuntu hirsute-security universe
deb http://security.ubuntu.com/ubuntu hirsute-security multiverse