A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pyenv/pyenv/issues/264 below:

pyenv init getting into an infinite loop when invoked from bashrc · Issue #264 · pyenv/pyenv · GitHub

The current installation instructions suggest to place the line
eval "$(pyenv init -)"
at the end of .bash_profile or .bashrc depending on the Linux flavor.

This suggestion may lead to the following scenario:

  1. The user puts it into .bashrc because that's where he is used to placing bash environment configuration.
  2. The corresponding Linux flavor has bash configured to execute .bashrc on each bash invocation (not sure about Ubuntus, but this seems to be normal behaviour for many Linux flavors).
  3. On login, the .bashrc is executed
  4. The code in .bashrc reaches "pyenv init"
  5. pyenv is an executable script which has #!/usr/bin/env bash specified as the interpreter
  6. Consequently, bash is fired up to execute the script.
  7. The new bash executes .bashrc
  8. GOTO 4

Obviously, the immediate fix for the problem is to put the initialization line into .bash_profile rather than .bashrc, however at the point in time, when the user encounters this error, this is far from obvious (in particular, this has been the reason for me to not start using pyenv the first time I tried it and had no time to debug the problem, and now it took quite some time to figure out what's happening).

It would be great to find some nice way to prevent this possibility for an infinite loop somehow. The options I'd see, in order of niceness:

vduseev, jasonkena, rjaduthie, lethinkrong, dli417 and 6 more


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4