1. python interpreter 추가
가상환경에 설치한 파이썬exe파일 추가, 선택
2. 가상환경 생성
프로젝트 하위에서
python -m venv {가상환경이름}
3. 활성화
cd {가상환경이름}/Scripts
activate.bat
서버에서 가상환경 실행하려면
source venv/bin/activate
activate 있는 경로도 다름!
4. 모듈 설치 방법
그냥 설치하려고 하면 아래 에러 발생함.
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
원인: Due to the removal of the long-deprecated pkgutil.ImpImporter class, the pip command may not work for Python 3.12.x.
파이썬 3.12 버전에서 pip은 아래와 같이 설치해야 한다.
python -m ensurepip --upgrade
python -m pip install --upgrade setuptools
python -m pip install {모듈이름}
'자율 학습 > 학습' 카테고리의 다른 글
| [Zabbix] 서버 모니터링 방법 (UserParameter) (0) | 2024.06.14 |
|---|---|
| [Linux] 프로세스 종료 명령어 pkill, kill, fuser 비교 (0) | 2024.06.12 |
| URI 스킴 딥링크 (0) | 2024.06.03 |
| [AWS] Lightsail 시작하기 (0) | 2024.05.16 |
| [Redis] Window 환경에 Redis 설치하기 (WSL, Ubuntu) (0) | 2024.05.12 |