Pip doesn't set PYTHONPATH correctly in PEP517 backend #3821
Unanswered
brandon-leapyear
asked this question in
Everyday usage
Replies: 1 comment 3 replies
-
I'm having a hard time figuring out what the specific Homebrew bug is here. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Minimal repro
First, set up the project:
I'm just using
requests
here to represent some third-party package that pip needs to install to run the backend. I'm actually usingpoetry-core
and it's failing when importingpoetry.core.masonry.api
, but I'm trying to use a more common library here to prove that it's not due to poetry.Building this project with the
pip
bundled by Homebrew directly fails:But doing it with a pip in a virtualenv resolves the import correctly and gets a different error:
Printing out
sys.path
inbackend.py
(and adding-v
to thepip wheel
command), I noticed that the two calls have different paths:Specifically, the plain pip call doesn't include the
overlay
ornormal
directories, which is where pip installs dependencies listed inbuild-backend
. The only thing I can think of is that Homebrew installs pip differently, in a way that creating a virtualenv installs a fresh unbroken pip.Notes
I recently upgraded to Monterey, not sure if this is related. I also completely uninstalled/removed Homebrew + reinstalled, but it's still happening on a fresh install.
Beta Was this translation helpful? Give feedback.
All reactions