poetry and pyenv don't work well together
See original GitHub issueI am using pyenv to manage my python versions and virtualenvs. This seems to cause some problems with poetry.
>> which python
~/.pyenv/shims/python
>> which pip
~/.pyenv/shims/pip
>> poetry run which python
~/.cache/pypoetry/virtualenvs/XXXXX-py3.6/bin/python
>> poetry run which pip
~/.pyenv/shims/pip
This seems to cause the issue, that packages are installed in to the python version set by pyenv, but the python interpreter is used from the poetry virtualenv. This is no problem, when I activate the virtualenv first and then run poetry install
But if I want to rely on poetry’s automatic virtualenv management, this doesn’t work anymore.
If you need more info I’ll gladly provide it.
Thanks for your great work and tool, it’s a real pleasure to work with 😃
Issue Analytics
- State:
- Created 5 years ago
- Reactions:38
- Comments:26 (7 by maintainers)
Top Results From Across the Web
Poetry does not use active pyenv when creating virtual ...
I'll do some debugging - I'm having trouble locating the code where poetry detects the Python version, once I find where that is...
Read more >Using Poetry with PyEnv and having Python version issues
I can do a pyenv local 3.10.0 without any issue and the project uses it. But using the poetry env use command errors...
Read more >Get started with pyenv & poetry. Saviours in the python chaos!
Organise your python chaos with pyenv and poetry. This post shows how to set it up and some basic examples to get started....
Read more >Modern Python part 1: start a project with pyenv & poetry
We are going to see here how to use two of them: Pyenv, to manage and install different Python versions, and Poetry, to...
Read more >Starting with pyenv & poetry for Python development - Medium
Pyenv : This is a python environment manager, allows to install and run off multiple python installations on the same machine.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am currently using
pyenv
on MacOS and I don’t have any problem making it working.I didn’t do anything special, I only have this on my
.zshrc
:Just to give my feedback here, I’m new to poetry and encountered issues when using pyenv and poetry together. Basically, it installed packages to a newly created virtualenv directory that was then nowhere to be found, poetry shell didn’t work, etc.
I installed poetry using
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
. My python used there is python 3.7.1 from ~/.pyenv/shims/python. Then I went to my code repository, activated my pyenv virtualenv, executedpoetry install
and had the problems mentioned above.I’m just commenting here, because I believe there is some underlying issue here that’s not fixed.