본문 바로가기

반응형

python

[python] ModuleNotFoundError: No module named 'PIL' python ModuleNotFoundError: No module named 'PIL' 테스트 환경 $ sw_vers ProductName:macOS ProductVersion:12.5 BuildVersion:21G72 $ python --version Python 3.9.13 Module Not Found Error Traceback (most recent call last): File "/Users/.../convert_image.py", line 2, in from PIL import Image ModuleNotFoundError: No module named 'PIL' pillow(PIL) 모듈 설치 pip 명령을 사용하여 pillow(PIL) 모듈 설치 pip3 install Pillow $ .. 더보기
[python] 파이썬 로또 번호 생성기 파이썬 로또 번호 생성기 lotto_v1.py 생성 import random ### 로또 번호 생성 def lotto_numbers(): numbers = random.sample(range(1, 46), 6) numbers.sort() print(numbers) ### 로또 시행 횟수 def lotto_count(): count = int(input("시행 횟수 : ")) print("#" * 30) if 0 < count range object range(start, stop[, step]) range() : 시작(포함), 끝(제외), step(옵션) ex) range(1, 46), 6 = 시작(1), 끝(45) 실행 $ python lotto_v1.py 시행 횟수 : 1 ###############.. 더보기
python 모듈 탐색 경로 찾기 python 모듈 탐색 경로 찾기 테스트 환경 $ python --version Python 3.9.13 파이션 3.9의 sys.path 값 - 임포트할 모듈 경로 python import sys for place in sys.path: print(place) $ python Python 3.9.13 (main, Aug 7 2022, 01:19:39) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> for place in sys.path: ... print(place) ... /opt/homebrew/Cella.. 더보기
[리눅스] fabric 라이브러리 설치 fabric 라이브러리 설치 설치 환경 $ cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) fabric 설치 yum install -y epel-release yum install -y python3-devel python3-pip python3-setuptools python3 --version $ python3 --version Python 3.6.8 pip3 install fabric fab --version $ fab --version Fabric 2.5.0 Paramiko 2.7.2 Invoke 1.5.0 더보기
AWS CloudWatch 경보를 Slack으로 보내는 방법 AWS CloudWatch 경보를 Slack으로 보내는 방법 CloudWatch 경보가 발생하면 Lambda 함수가 실행되어 Slack으로 메시지를 전송합니다. 시스템 구성 1. Amazon SNS 1-1. 주제 생성 이름 : cloudwatch-notification 1-2 구독 메일 확인 1-3 메시지 게시(메시지 발송 테스트) 메일 확인 2. Slack Webhook URL 생성 Slack 워크스페이스에서 Incoming Webhooks을 활성화하고 Webhook URL을 생성합니다. slack webhooks(incoming webhooks) 생성 방법 https://sangchul.kr/784 #cluodwatchalert https://hooks.slack.com/services/T018562.. 더보기
[url] Python PyCharm PyCharm(python 프로그램) https://www.python.org/downloads/release https://www.jetbrains.com/pycharm/download/#section=windows 더보기

728x90
반응형