본문 바로가기

ERROR16

[Poetry] EC2 ubuntu환경 NoCompatiblePythonVersionFound Error 1️⃣ 문제 AWS 배포 과정 중 프로젝트의 Poetry가 3.11 버전이상의 파이썬을 필요로 하는데, 기본적으로 ubuntu는 3.10.6이 설치되어있다. poetry shell The currently activated Python version 3.10.6 is not supported by the project (^3.11). Trying to find and use a compatible version. NoCompatiblePythonVersionFound Poetry was unable to find a compatible version. 2️⃣ 시도 아래 명령어로 python 3.11 설치해줬다. sudo apt install python3.11 그런데 짜잔~ poetry shell The.. 2023. 6. 1.
N2T - Notion 2 Tistory 사용하기 - Errors 유니코드 디코드 에러. cp949 오류 구글링해서 찾아보니 pip install -r requirements.txt 파일을 읽어올 때, 윈도우와 리눅스에서 주로 사용하는 인코딩 방식인 'cp949'와 'utf-8'은 파일에 한글을 저장하는 방식이 다르다고 한다. cp949 : 한글 하나당 2바이트로 저장 utf-8 : 한글의 초성, 중성, 종성 각각을 1바이트로 저장 링크를 참고해보면 파이썬 설치 경로\lib\distutils\text_file.py와 lib\configparser.py에 open을 encoding='UTF8'을 추가해 수정하라고 되어있었다. 링크를 참고해서 수정 ↓ 수정해도 여전히 오류가 발생한다면 더보기 이후 재부팅 그 이후 오류들 더보기 이 부분에서 except에 해당하는 Value.. 2023. 5. 17.
AWS EC2 instance connect - ERR_CONNECTION_REFUSED EC2 - instances - Launch instances instance name 입력 Ubuntu instance type - t2.micro keypair 선택 Launch instance instance_id 클릭 후 - Security - Inbound rules에 http, https 추가해주고, Connect sudo apt-get update sudo apt-get install nginx sudo systemctl start nginx 이후 https로 들어갔을때, ERR_CONNECTION_REFUSED 발생 해결방법 https 연결 방법은 아직 추가로 설정해줘야 할 것들이 있음. http로 들어가기 2023. 5. 2.
dotenv 설치 시 AttributeError, has no attribute 'read_dotenv' 1. AttributeError : module 'setuptools' has no attribute '_install_setup_requires' dotenv 설치 명령어 입력시 에러 발생 더보기 $ poetry add dotenv Using version ^0.0.5 for dotenv Updating dependencies Resolving dependencies... Package operations: 1 install, 0 updates, 0 removals • Installing dotenv (0.0.5) ChefBuildError Backend subprocess exited when trying to invoke build_wheel Traceback (most recent call las.. 2023. 4. 25.
Postman에서 토큰 인증 로그인(authentication)이 안될 때 token인증 방식에서 request.user를 받아오지 못할 때(= AnonymousUser로 찍힐 때) 확인해볼 사항들 1.토큰이 생성되는가? api/token/(혹은 jwt별 토큰 경로) 으로 요청을 보냈을 때, TokenObtainPairView에서 access토큰과 refresh토큰이 발급되는지 확인 2. authentication class와 Middleware가 잘 지정되어 있는가? #settings.py REST_FRAMEWORK = { "DEFAULT_AUTHENTICATION_CLASSES": ( "rest_framework_simplejwt.authentication.JWTAuthentication", ) } #settings.py MIDDLEWARE = [ ... "django.co.. 2023. 4. 23.
Failed building wheel for backports.zoneinfo 에러 requirements.txt를 이용해 라이브러리를 설치 중 특정 파일에서 계속 에러가 발생. $ pip install -r requirements.txt Collecting asgiref==3.6.0 Using cached asgiref-3.6.0-py3-none-any.whl (23 kB) Collecting backports.zoneinfo==0.2.1 Using cached backports.zoneinfo-0.2.1.tar.gz (74 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting Dja.. 2023. 4. 9.
python 가상환경 venv는 생성되지만 activate가 안되는 오류 파이썬에서 기본적으로 가상환경을 생성할 때는 다음과 같은 명령어를 입력한다. 이렇게 명령어를 입력 시 1. Scripts 폴더 내에 python.exe와 pythonw.exe가 먼저 생성되고, 2. 나머지 파일들이 시간차를 두고 생성되는 것을 확인할 수 있다. 1번 상태에서 모종의 이유로 2번으로 진행하지 않고 멈춰버리는 경우가 있다. 이때는 가상환경이 잡히긴 하나, venv를 activate 할 수 없다. 명령어를 입력해도 가상환경이 활성화되지 않고, 직접 Select Interpreter를 통해 가상환경으로 변경해도 활성화 되지 않는다. # venv activate 명령어 # window venv\Scripts\activate # 또는 venv\Scripts\activate.bat # mac / li.. 2023. 4. 7.