-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
poetry install --sync attempts to remove itself when poetry is installed to a different venv #7623
Comments
not a lot of help I'm afraid, but I can report that your script does not have that effect for me (on ubuntu 22). The final probably not going to be a poetry bug I guess, but I don't think I can help you to debug it to be sure. |
I couldn't repro it on any non-osx environments I tried it on; I'm assuming it's something similar to the relocatable binary problems osx has had in the past, except I believe these tested poetry versions have the workarounds already |
I've successfully reproduced this with the system python 3.8.2 on osx 11.2.1 20D75 (big sur), so it's definitely not just the ancient 10.15 version |
The problem appears to be fixed on with python 3.9.6 on osx 13.2.1 22D68 (ventura). |
In the below, poetry is installed into the Part 1So, I added a print statement to poetry.utils.env.VirtualEnv:
And what I see is: working system
failing system(note: as above, i've redacted the real HOME path with $HOME)
This shows that Part 2This is particularly strange, because when I run the GET_SYS_PATH code directly using the venv python version, i see:
Whereas when I run it with the meta python:
In other words, maybe Part 3I edited VirtualEnv.run as follows:
And reran: working
failing
So, it's running with the correct python but somehow ending up with the wrong path, and running exactly the same command in part 2 and part 3 gets different answers. Part 4The environment, maybe?
to VirtualEnv.run on the failing machine. It's difficult to paste the outputs directly (lots of redaction required) but I compared the env debug outputs of the script with
Oh, a smoking gun. That environment variable led me to tox-dev/tox#148 |
So, I'm not sure what to do with this information because I'm not quite sure what this env var is for, other than everyone seems to remove it:
Obviously, this problem is fixed in later python versions, but, would you consider putting a workaround for this into poetry as well, since the affected OSX versions are still in the wild? |
The env keyword contains the modified path (that uses get_temp_environ) so without it, anything using the `input` path here would get the wrong env. fixes python-poetry#7623
OH. Okay. I found the bug. --^ |
The env keyword contains the modified path (that uses get_temp_environ) so without it, anything using the `input` path here would get the wrong env. fixes python-poetry#7623
The env keyword contains the modified path (that uses get_temp_environ) so without it, anything using the `input` path here would get the wrong env. fixes python-poetry#7623
The env keyword contains the modified path (that uses get_temp_environ) so without it, anything using the `input` path here would get the wrong env. fixes python-poetry#7623 (cherry picked from commit 4a27e8f)
The env keyword contains the modified path (that uses get_temp_environ) so without it, anything using the `input` path here would get the wrong env. fixes python-poetry#7623 (cherry picked from commit 4a27e8f)
The issue still exists for a conda managed virtual environment with python3.10 and poetry1.5.1. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option) and have included the output below.Issue
I'm seeing a weird problem where poetry attempts to remove itself when
poetry install --sync
is run. However, unlike other examples of this, poetry is not installed into the venv it's attempting to manage. Here's a link to my repro script.Here's me running it (with minor redaction):
As you can see from this, poetry is installed into a completely different venv, and it's trying to remove itself. The value of
virtualenvs.in-project
does not matter (i'm just using it for easier cleanup). As mentioned above, it repros on several poetry releases, so it's obviously something somewhat fundamental. I know the system python on OSX is notoriously bad, but I was hoping could direct me more in debugging. Thanks!The text was updated successfully, but these errors were encountered: