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

_pyenv_virtualenv_hook still in $PROMPT_COMMAND after uninstall #482

Open
10 of 12 tasks
gmolau opened this issue Jun 28, 2024 · 3 comments
Open
10 of 12 tasks

_pyenv_virtualenv_hook still in $PROMPT_COMMAND after uninstall #482

gmolau opened this issue Jun 28, 2024 · 3 comments

Comments

@gmolau
Copy link

gmolau commented Jun 28, 2024

I was using pyenv+pyenv-virtualenv installed via brew on macOS. I uninstalled it and removed virtualenv-init from my bashrc, but it still gets added to PROMPT_COMMAND which now makes every new terminal fail with -bash: _pyenv_virtualenv_hook: command not found.

Too many issues will kill our team's development velocity, drastically.
Make sure you have checked all steps below.

Prerequisite

  • Make sure your problem is not listed in the common build problems.
  • 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 not asking us to help solving your specific issue.
    • GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
  • 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.

Description

  • Platform information (e.g. Ubuntu Linux 20.04): macOS
  • OS architecture (e.g. amd64): arm64
  • pyenv version: 2.4.3
  • pyenv-virtualenv version: 1.2.3
  • Python version: 3.12.2
  • virtualenv version (if installed):
  • Please attach the debug log of a faulty Pyenv invocation as a gist
    • If the problem happens in a Pyenv invocation, you can turn on debug logging by setting PYENV_DEBUG=1, e.g. env PYENV_DEBUG=1 pyenv install -v 3.6.4
    • If the problem happens outside of a Pyenv invocation, get the debug log like this:
      # for Bash
      export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
      # for Zsh
      export PS4='+(%x:%I): %N(%i): '
      
      set -x
      <reproduce the problem>
      set +x
      
@native-api
Copy link
Member

MacOS uses Zsh as its default shell. Look in ~/.zshrc.

@gmolau
Copy link
Author

gmolau commented Jul 2, 2024

My default shell is set to bash though, and even when removing pyenv from all zsh files the problem still persists.

❯ echo $SHELL
/opt/homebrew/bin/bash

@native-api
Copy link
Member

native-api commented Jul 2, 2024

Then look where it's set in your shell startup files. The following command makes Bash that $SHELL points to trace executing its startup files (lots of output!):

PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' $SHELL -l -x

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

2 participants