Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting virtualenvs.prefer-active-python does not exist #54

Closed
mlineen opened this issue Feb 12, 2025 · 4 comments
Closed

Setting virtualenvs.prefer-active-python does not exist #54

mlineen opened this issue Feb 12, 2025 · 4 comments

Comments

@mlineen
Copy link

mlineen commented Feb 12, 2025

Installation of poetry 2.0.1 fails because setting virtualenvs.prefer-active-python does not exist

% asdf install poetry
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

/Users/USERNAME/.asdf/installs/poetry/2.0.1/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (2.0.1): Done

Poetry (2.0.1) is installed now. Great!

To get started you need Poetry's bin directory (/Users/USERNAME/.asdf/installs/poetry/2.0.1/bin) in your `PATH`
environment variable.

Add `export PATH="/Users/USERNAME/.asdf/installs/poetry/2.0.1/bin:$PATH"` to your shell configuration file.

Alternatively, you can call Poetry explicitly with `/Users/USERNAME/.asdf/installs/poetry/2.0.1/bin/poetry`.

You can test that everything is set up by executing:

`poetry --version`

Configuring poetry to behave properly with asdf ...
Running: "poetry config virtualenvs.prefer-active-python true".


Setting virtualenvs.prefer-active-python does not exist

Cleanup: Something went wrong!

60 /Users/USERNAME/.asdf/plugins/poetry/bin/install: "$install_path"/bin/poetry config virtualenvs.prefer-active-python true
@amickael
Copy link

+1 also having this issue.

@DimitriKouliche
Copy link

Same here.

@andsarr
Copy link

andsarr commented Feb 15, 2025

I think the replacement for Poetry >=2.0.0 is virtualenvs.use-poetry-python. The description is:

By default, Poetry will use the activated Python version to create a new virtual environment. If set to true, the Python version used during Poetry installation is used.

The setting virtualenvs.prefer-active-python, which seems to be only for version 1.x has this description:

Use currently activated Python version to create a new virtual environment. If set to false, Python version used during Poetry installation is used.

@crflynn
Copy link
Member

crflynn commented Feb 22, 2025

This was fixed with #49 and #50 .
If you are not using the latest version of the plugin you can upgrade with asdf plugin-update poetry or mise plugins update poetry

@crflynn crflynn closed this as completed Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

5 participants