-
-
Notifications
You must be signed in to change notification settings - Fork 420
pyenv-virtualenv is not compatible with brew pyenv-sync #505
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
Comments
This is Pyenv-Sync's problem. As per PEP 394, custom Python environments are expected to provide the See pyenv/pyenv#3105 for a similar issue. A possible fix is to make Homebrew somehow create the |
@native-api Actually, the behaviour you requre, pointing at PEP-394 got patched in the PEP years ago: python/peps#989 Reading the PEP it has this sentence in it's first paragraph of the abstract now:
So actually it is NOT required to have a Please fix pyenv-virtualenv so it treats PEP-394 as optional as the PEP states. |
This phrase in the PEP refers to the default, system-provided Python. Pyenv-managed installations are not system-provided Pythons. The PEP goes on to say (emphasis mine):
There isn't a specific section for private alternative installations, so Pyenv falls under "similar tool". |
In fact, as a corollary of the PEP, we cannot, in the general case, use an executable name other than While the vast majority of installations are Python 3 and thus provide Actually, |
Please read the PEP. |
Pyenv-managed installations are activated environments. You explicitly activate them by selecting a version to use other than |
The fact that the activation process looks different doesn't matter -- the principle and the net effect are the same. |
I want to install and manage Python instances with
brew
. Unfortunately, this plugin seems incompatible with a feature calledpyenv-sync
, that automatically links the brew installations withpyenv
versions. Whenever I try to use a version different thansystem
, e.g.pyenv --debug virtualenv 3.10 venv
, the command exits with error code 127 and echopyenv: pip: command not found
.I found that fixing this issue with this commit introduces issue. It is because
pyenv-virtualenv
script assumes that versions different thansystem
are virtualenvs and usespython
as the python binary. In result the script does not resolve pip properly and the whole creation of venv fails.pyenv virtualenv --version
points at virtualenv that is installed system-wide and uses python@3.13 as a dependencyI quickly analysed the script and IMO the easiest way to fix that is to add
python3
as a fallback indetect_venv()
when PYENV_VERSION is not equal to "system"The text was updated successfully, but these errors were encountered: