`pyenv virtualenv (version) (name)` ignores specified version and uses homebrew's `python` version

Aperta
#531 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, shell
Ambito
cli

Direzione di ricerca

Reproduce by running pyenv virtualenv 3.12.3 myEnv with a Homebrew Python active, then check which interpreter the env's bin symlinks point to and what pyenv virtualenvs reports. The payload names no source files, so start from the plugin's virtualenv command and trace how it resolves the Python executable when a version argument is given. Done means the created env links to the requested 3.12.3 interpreter, not the shell's default.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Prerequisite
  • Make sure no duplicated issue has already been reported in the pyenv-virtualenv issues. You should look in closed issues, too.
  • Make sure you are reporting a problem in Pyenv-Virtualenv and not seeking consultation with Pyenv-Virtualenv use.
  • Make sure your problem is not derived from packaging (e.g. Homebrew).
    • Please refer to the package documentation for the installation issues, etc.
  • Make sure your problem is not derived from other plugins.
    • This repository is maintaining the pyenv-virtualenv plugin only. Please refrain from reporting issues of other plugins here.
Describe the bug

I have a general system-wide python managed by homebrew (for general use outside of projects). and for specific projects I use a virtualenv, managed via pyenv-vertualenv

But for some reason, whenever I create a virtualenv now, it's created under the ~/.pyenv/versions directory that I specify, but it will actually link to whatever version of python the shell I was in was using (generally, /opt/homebrew/opt/[email protected], via system set in ~/.pyenv/version).

Reproduction steps

So I create the virtualenv like

python virtualenv 3.12.3 myEnv

this completes correctly, but when I do pyenv virtualenvs, the new env shows up like

3.12.3/envs/myEnv (created from /opt/homebrew/opt/[email protected])

When I activate myEnv, and do python --version, it says Python 3.14.0

And the symlinks in ~/.pyenv/versions/3.12.3/envs/myEnv/bin all link to /opt/homebrew/opt/[email protected]/bin/python3.14

Diagnostic details
  • Platform information: Macos 26.6.2 (Tahoe)
  • OS architecture: ARM (Apple M5 Pro?)
  • pyenv version: 2.6.12
  • pyenv-virtualenv version: 1.2.4
  • Python version: system is 3.14, trying to use 3.12.3
  • virtualenv version (if installed): none
  • Please attach the debug log of a faulty Pyenv invocation as a gist

I don't really have a log to share, there's no error it's just doing the wrong thing.

Lingua principale
Shell
Stelle
6.7k
Fork
433
Merge medio
1g 8h
PR unite (30g)
11

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pyenv/pyenv-virtualenv

Tutte le issue di pyenv/pyenv-virtualenv

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.