hypermodern-python icon indicating copy to clipboard operation
hypermodern-python copied to clipboard

Issue with pyenv shell initialization as documented in blog post

Open jdeaton opened this issue 4 years ago • 2 comments

While reviewing Part 1 of the corresponding blog series it appears that one of the shell commands needs updated for more recent versions of pyenv. After running the following shell commands and later doing pyenv local <version #>, I found that things were not working as expected where python was mapped to the appropriate local versions. This was all done on macOS with Homebrew installed pyenv/poetry.

export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

After browsing around I found several posts that suggested that the eval "$(pyenv init -)" needed to be changed to eval "$(pyenv init --path)" for more recent pyenv than was available when the posts were done. After doing this things seemed to work as advertised.

References:

  • https://github.com/pyenv/pyenv/issues/2014
  • https://stackoverflow.com/questions/68462156/upgraded-pyenv-by-brew-now-only-system-python-activated-on-new-terminal

jdeaton avatar Oct 26 '21 19:10 jdeaton

Thank you for reporting this! You're right, this should be updated.

It may take a while until I get to fix this, but feel free to submit a PR to https://github.com/cjolowicz/blog (see content/posts) in the meantime.

cjolowicz avatar Oct 26 '21 20:10 cjolowicz

I've found a couple other other small updates in later sections as well since I've worked through it. I'll go ahead and do a PR on your blog repo to capture them as I go and then close this issue.

jdeaton avatar Oct 27 '21 15:10 jdeaton