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

option to not initialise automatic environment activation #415

Open
mbway opened this issue Dec 14, 2021 · 0 comments
Open

option to not initialise automatic environment activation #415

mbway opened this issue Dec 14, 2021 · 0 comments

Comments

@mbway
Copy link

mbway commented Dec 14, 2021

I have had a similar experience to many others (#411 #346 #265 #259) with pyenv-virtualenv being extremely slow

  • adding ~200ms every time I press enter
  • adding ~300ms when opening a new shell

(note I have a 16 core 9900k, my machine is not the issue. from #259 it looks like this could be related to my antivirus)

To work around this I have made a few changes to my initialisation which may be slightly hacky but they at least give me a usable shell:

export PYENV_VIRTUALENV_DISABLE_PROMPT=1
export PATH="${HOME}/.pyenv/plugins/pyenv-virtualenv/shims:${PATH}"
export PS1='(${PYENV_VERSION}) '$PS1

So I have my own version of the virtualenv prompt which seems to work well so I don't see why the default has to be so slow, but I assume it doesn't work in all cases or something?

But the main point is that I took only the PATH altering part of pyenv virtualenv-init - leaving out the prompt hook for activating local environments since I don't use them. It would be nice if I could use an official command like pyenv virtualenv-init --no-local - instead?

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