-
Notifications
You must be signed in to change notification settings - Fork 433
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
FileNotFoundError for pipx_shared.pth with pipx install --python
and pyenv
#334
Comments
Looks like a bad interaction with pyenv and pipx_shared.pth . This reminds me a little of #294, in that it seems like a problem involving both pyenv and pipx_shared.pth. My guess is that this has something to do with detecting which python we're using, and that is getting messed up because of the use of pyenv. It's interesting to note that even though |
The first problem that happens when using I can successfully
What never works (even in the pipx code)
Something very weird is going on. Observe me trying to use subprocess in python3.7.6 to make a venv with python3.8:
On macOS, there's some kind of voodoo with the environment variable
I'm wondering if running pipx from a macOS Framework python build, and using a subprocess to start a pyenv build of python (probably NOT a Framework build) is confusing which python gets built in the venv. This could also be why @bhrutledge is able to succeed when he uses the 3.8 homebrew build, as the 3.8 homebrew build WILL be a Framework build. |
Well I made progress. If I remove Afterwards it cannot find (Not that I exactly know what I'm doing by removing |
Hm. Now the problem is that it thinks that it should install the Which is why it is not finding pip. |
Ah it turns out that So I can fix this bug, if every time we use a I have no idea what side effects that might cause. |
Thanks for for the investigation, @itsayellow. I'm glad it's not just me. :) This reminded me of a chat I had at PyCon with a current maintainer of virtualenv. He said one of the reasons for its continued existence is that it facilitates creating virtual environments using different Might there be any other workarounds? If not, instead of deleting |
Possibly relevant? https://virtualenv.pypa.io/en/latest/reference/#compatibility-with-the-stdlib-venv-module Has there been any discussion of pipx using virtualenv instead of venv? |
👍 thanks for the link, that's a lot of useful information. (Some I'm still trying to parse in my head!)
Not really, I think we were trying to stay with the built-in venv because pipx is a python3.6+ tool, and so far
It's a fair question. Originally I believe that all env variables were implicitly used. Later, we specifically removed As far as |
I just reinstalled using |
Glad it works for you! Thanks for your help on this issue. |
Describe the bug
I have pipx installed from Homebrew (yay!), as well as pyenv. When I run
pipx install black
, the resulting venv using the python3.7 interpreter from Homebrew. When I runpipx install --python python3.8 black
(or any other version, with any other package), I get the error mentioned in the issue title and reproduced below.How to reproduce
Expected behavior
pipx should install a package using the python3.8 interpreter from pyenv.
I get the same error using an absolute path with
--python $(pyenv which python3.8)
, but--python $(brew --prefix [email protected])/bin/python3
works.The text was updated successfully, but these errors were encountered: