Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Currently activated version is not supported by the project #6037

Answered by mbnoimi
mbnoimi asked this question in Q&A
Discussion options

How can I fix this issue?
Poetry doesn't create the suitable env and switch to it!

May you please help me to fix this issue as I'm still newbie to Poetry?

log

$ poetry -V
Poetry version 1.1.14

$ poetry install
The currently activated Python version 3.8.10 is not supported by the project (^3.9).
Trying to find and use a compatible version. 

  NoCompatiblePythonVersionFound

  Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command.

  at ~/.poetry/lib/poetry/utils/env.py:768 in create_venv
       764│                     python_minor = ".".join(python_patch.split(".")[:2])
       765│                     break
       766│ 
       767│             if not executable:
    →  768│                 raise NoCompatiblePythonVersionFound(
       769│                     self._poetry.package.python_versions
       770│                 )
       771│ 
       772│         if root_venv:

pyproject.toml

[tool.poetry.dependencies]
python = "^3.9"
SQLAlchemy = {extras = ["asyncio"], version = "^1.4.29"}
python-dotenv = "^0.19.2"
pydantic = {extras = ["email"], version = "^1.9.0"}
alembic = "^1.7.5"
asyncpg = "^0.25.0"
fastapi-users = {extras = ["sqlalchemy2"], version = "^9.2.0"}

Installed pyenv by following the official docs then installed some python versions:

$ pyenv versions
* system (set by /home/laptop/.python-version)
  3.9.13
  3.10.5

$ poetry env use 3.9.13
pyenv: python3.9: command not found

The `python3.9' command exists in these Python versions:
  3.9.13

Note: See 'pyenv help global' for tips on allowing both
      python2 and python3 to be found.

  EnvCommandError

  Command python3.9 -c "import sys; print('.'.join([str(s) for s in sys.version_info[:3]]))" errored with the following return code 127, and output: 
  

  at ~/.poetry/lib/poetry/utils/env.py:378 in activate
       374│                     shell=True,
       375│                 )
       376│             )
       377│         except CalledProcessError as e:
    →  378│             raise EnvCommandError(e)
       379│ 
       380│         python_version = Version.parse(python_version.strip())
       381│         minor = "{}.{}".format(python_version.major, python_version.minor)
       382│         patch = python_version.text

$ poetry env use ~/.pyenv/versions/3.9.13
/bin/sh: 1: /home/laptop/.pyenv/versions/3.9.13: Permission denied

  EnvCommandError

  Command /home/laptop/.pyenv/versions/3.9.13 -c "import sys; print('.'.join([str(s) for s in sys.version_info[:3]]))" errored with the following return code 126, and output: 
  

  at ~/.poetry/lib/poetry/utils/env.py:378 in activate
       374│                     shell=True,
       375│                 )
       376│             )
       377│         except CalledProcessError as e:
    →  378│             raise EnvCommandError(e)
       379│ 
       380│         python_version = Version.parse(python_version.strip())
       381│         minor = "{}.{}".format(python_version.major, python_version.minor)
       382│         patch = python_version.text
You must be logged in to vote

This issue doesn't occur with venv so I dropped pyenv for good.

Replies: 2 comments

Comment options

This issue doesn't occur with venv so I dropped pyenv for good.

You must be logged in to vote
0 replies
Answer selected by mbnoimi
Comment options

What is the "currently activated Python version: from poetry's point of view?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.