본문 바로가기
ERROR

[Poetry] EC2 ubuntu환경 NoCompatiblePythonVersionFound Error

by 코드뭉치 2023. 6. 1.

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 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.

여전히 python 버전을 못찾고 있었다.

--version으로 파이썬의 버전을 확인해보니 여전히 3.10.6

python3 --version
Python 3.10.6

 

이후 파이썬의 config python으로 기본 사용 파이썬을 지정해주었다.

sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).

  Selection    Path                 Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3      11        auto mode
  1            /usr/bin/python3      11        manual mode
  2            /usr/bin/python3.11   2         manual mode

이후 파이썬은 3.11로 정상적으로 버전확인.

python -V
Python 3.11.0rc1

아직도 poetry는 버전을 못찾고 있었다.

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.

 

3️⃣ 해결

 

poetry env use 명령어를 통해 해결

poetry env use python3.11

댓글