pshtt icon indicating copy to clipboard operation
pshtt copied to clipboard

setup-env is looking in limited places for pyenv-virtualenv

Open arcsector opened this issue 2 years ago • 0 comments

🐛 Summary

./setup-env script needs to look for pyenv-virtualenv in all places it's setup to be detected, not just the MacOS location.

To reproduce

Steps to reproduce the behavior:

  1. Install pyenv and pyenv-virtualenv on WSL2 as described in https://github.com/pyenv/pyenv and https://github.com/pyenv/pyenv-virtualenv, installing pyenv-virtualenv as a plugin as the docs describe
  2. Place necessary configs in ~/.bashrc and reload shell
  3. Attempt to run ./setup-env
  4. Observe the check for pyenv-virtualenv failing, even though one can run pyenv virtualenvs with a space just fine

Expected behavior

The check needs to detect the pyenv-virtualenv binary in the correct directory or check for the existence of pyenv virtualenv with a space instead. The easiest way to do this would be to check in the locations that pyenv-virtualenv describes to install it:

  1. $(pyenv root)/bin
  2. $(pyenv root)/plugins/pyenv-virtualenv/bin

You could also detail that users may need to symlink or otherwise add the plugin's bin to their path in their bashrc:

echo "export PATH="$PATH:$HOME/.pyenv/plugins/pyenv-virtualenv/bin" >> ~/.bashrc

Any helpful log output or screenshots

Output of setup-env test before adding to path:

> command -v pyenv-virtualenv

>

Output of setup-env test after adding to path:

> command -v pyenv-virtualenv
/home/user/.pyenv/plugins/pyenv-virtualenv/bin/pyenv-virtualenv

arcsector avatar May 17 '23 21:05 arcsector