- 1 year ago
Installing pyenv-win on top of working wsl2 Ubuntu instance breaks Ubuntu pyenv
If you have installed pyenv-win
on top of a working WSL2 Ubuntu instance and it has broken your Ubuntu pyenv
, it's likely because both pyenv
installations are sharing the same environment variables, and the Windows installation has taken priority.
To fix this issue, you can try the following steps:
Uninstall
pyenv-win
: Uninstallpyenv-win
from your Windows environment by following the instructions in thepyenv-win
documentation.Reset your environment variables: Open a new Ubuntu terminal and run the following commands to reset your environment variables to their default values:
bashunset PYENV_ROOT
unset PATH
source ~/.bashrc
Reinstall
pyenv
in Ubuntu: Installpyenv
in Ubuntu using the official installation instructions. Make sure to follow the Ubuntu-specific instructions, as they may differ slightly from the generic instructions.Test
pyenv
in Ubuntu: Verify thatpyenv
is working properly in Ubuntu by running thepyenv
command and checking that it returns the correct output.
By following these steps, you should be able to reinstall pyenv
in Ubuntu and get it working properly again without interference from the pyenv-win
installation in Windows.