Repository navigation
pipx and poetry interact with conda
#1352
Replies: 1 comment
|
There are three separate environments here: the environment containing pipx, pipx’s environment for the Poetry application, and the environment Poetry uses for your project. Exposing Poetry uses an already active virtual environment rather than creating another one. I checked this with Poetry 2.5.1 and a real micromamba environment: with that Conda environment active, For two Poetry versions, give the pipx installations distinct suffixes: pipx install --suffix=-v1 'poetry==1.8.5'
pipx install --suffix=-v2 'poetry==2.5.1'This exposes If you want Poetry to manage separate project environments, first leave your active Conda environment. Then, from each project’s directory, select its interpreter with the appropriate Poetry command: # Project A
poetry-v1 env use /absolute/path/to/python3.11
poetry-v1 install
poetry-v1 env info --path
# Project B
poetry-v2 env use /absolute/path/to/python3.14
poetry-v2 install
poetry-v2 env info --pathReplace those paths with interpreters compatible with each project’s Python requirement. I tested this pairing with pipx 1.17.12: the Poetry applications both ran on Python 3.11.17, while project A ran on 3.11.17 and project B on 3.14.4 in distinct project environments. Select the named Poetry command for the project; its own interpreter and the project’s interpreter can differ. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm not clearly about the virtual environments.
In ubuntu, are these steps following the best practices?
What's the case for conda?
Here is my question, when using anaconda, since poetry is global available via
~/.local/bin/poetry, if I have another project need another version of poetry and python. How can I switch the two project seamlessly?All reactions