-
Notifications
You must be signed in to change notification settings - Fork 434
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
Failing to create venv when passing --python version on linux #1195
Comments
This is also failing in the same way on MacOS. |
Out of interest @robinbowes and @danyeaw - is this happening for you on pyenv managed interpreters as well or on standalone interpreters? Trying to narrow the bug down so I can write a test for my fix. |
Yea, I pretty much only use pyenv-managed interpreters. |
@Gitznik It is happening on both. Here is a traceback from GitHub Actions with pipx by default installed on the runner with no pyenv: https://github.com/gaphor/gaphor/actions/runs/7474993163/job/20342622526 |
Ah yes, I'm seeing this on GitHub actions too. |
Awesome, thank you both for clarifying! |
Bitten by this too in GHA (but I reproduce locally via brew-installed pipx), and if I'm not mistaken, GHA will likely not release a version with an upgraded pipx until probably a few weeks. I guess we need a workaround. Do you have anything better to suggest? |
I'm trying to see if I can come up with a fixing PR. It seems the culprit is 81c2fa5 When we pass |
Hi @ewjoachim , that is indeed the reason, and I implemented a fix that is currently awaiting review, see the linked PR. |
Oh, I missed that PR ! Sorry / congratulations for the PR :) |
|
Thanks and no worries, just wanted to spare you sinking more time into this 🙂 |
Describe the bug
It looks like since #1168 pipx is no longer able to create a virtual environment when passing
--python
(at least on linux and with pyenv managed versions). It still works fine if a venv already exists.From my tests I assume it's caused by how
os.path.realpath
creates the file path to the python executable provided. I've only tested this with python versions being managed by pyenv.How to reproduce
pipx run --python=python3.11 pycowsay moo
Expected behavior
Creating a venv and then printing pycowsay.
The text was updated successfully, but these errors were encountered: