Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

$VIRTUAL_ENV and $PATH don't agree

Abierto
#494 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python, shell
Área
cli, tooling

Línea de trabajo

Start by reproducing the reported mismatch with pyenv-virtualenv 2.4.17, Python 3.12, and the shown Solus Linux environment. Trace how activation sets $VIRTUAL_ENV and how the shims select executables, then verify that both paths consistently identify the same virtual environment.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

pyenv sets $VIRTUAL_ENV to:

$PYENV_ROOT/versions/<version>/envs/<venv>

but the shims point to the symlinks:

$PYENV_ROOT/versions/<venv>/bin/*

That annoys Neovim and my OCD. See:

Python virtualenv ~
- WARNING $VIRTUAL_ENV is set to: /home/mick/.local/state/pyenv/versions/3.12.7/envs/mutaid-msgenc
  And its bin directory contains: python, python3, python3.12
  But $PATH yields this python executable: /home/mick/.local/state/pyenv/versions/mutaid-msgenc/bin/python
  And $PATH in subshells yields this python executable: /home/mick/.local/state/pyenv/versions/mutaid-msgenc/bin/python
  And $PATH yields this python3 executable: /home/mick/.local/state/pyenv/versions/mutaid-msgenc/bin/python3
  And $PATH in subshells yields this python3 executable: /home/mick/.local/state/pyenv/versions/mutaid-msgenc/bin/python3
  And $PATH yields this python3.12 executable: /home/mick/.local/state/pyenv/versions/mutaid-msgenc/bin/python3.12
  And $PATH in subshells yields this python3.12 executable: /home/mick/.local/state/pyenv/versions/mutaid-msgenc/bin/python3.12
  So invoking Python may lead to unexpected results.
  - ADVICE:
    - $PATH ambiguities in subshells typically are caused by your shell config overriding the $PATH previously set by the virtualenv. Either prevent them from doing so, or use this workaround: https://vi.stackexchange.com/a/34996
    - $PATH ambiguities arise if the virtualenv is not properly activated prior to launching Nvim. Close Nvim, activate the virtualenv, check that invoking Python from the command line launches the correct one, then relaunch Nvim.

Shouldn't $PATH and $VIRTUAL_ENV (both set by pyenv!) agree on this and not be set to different paths into the same virtualenv?

Description
  • Platform information (e.g. Ubuntu Linux 16.04):
    Solus Linux Budgie 4.6 convergence

  • OS architecture (e.g. amd64):
    x86_64

  • pyenv version:
    2.4.17

  • Python version:
    3.12

  • C Compiler information (e.g. gcc 7.3):
    gcc (Solus) 14.2.0

Lenguaje dominante
Shell
Estrellas
6.7k
Forks
427
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pyenv/pyenv-virtualenv

Todos los issues de pyenv/pyenv-virtualenv

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.