Skip to content
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

$VIRTUAL_ENV and $PATH don't agree #494

Open
5 tasks
pillmuncher opened this issue Nov 10, 2024 · 0 comments
Open
5 tasks

$VIRTUAL_ENV and $PATH don't agree #494

pillmuncher opened this issue Nov 10, 2024 · 0 comments

Comments

@pillmuncher
Copy link

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

@native-api native-api transferred this issue from pyenv/pyenv Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant