Back to Browse

How to switch between different python version on MacOS using pyenv

679 views
Jan 5, 2025
4:57

00:00 Introduction 00:30 pyenv installation 00:52 pyenv shell configuration 01:42 Listing pyenv version 02:02 Installing additional python versions 02:40 Switching between different python versions 03:50 Create a virtual environment with a specific python version 04:17 Solution if you are unable to switch between python versions 04:28 Solution if pyenv global command is not working Easily switch between multiple python versions using pyenv. I personally use this method to create virtual environment with specific python versions for various development environments. If you face issues with switching between python environments you can add the bellow line to .zshrc file which might fix the issue: 'eval "$(pyenv init --path)"' If you are unable to switch between python environments using pyenv global command consider removing .python-version file located in your home directory which might resolve the issue: rm .python-version Below are the links to the solutions mentioned above: https://www.reddit.com/r/learnpython/comments/vlqvbd/pyenv_is_not_working_on_macos_the_same_way_it/?rdt=50890 https://github.com/pyenv/pyenv/issues/331 Support the channel: https://buymeacoffee.com/opensourcehustle You can find articles and written formats of my youtube tutorials on my website: opensourcehustle.com

Download

1 formats

Video Formats

360pmp46.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

How to switch between different python version on MacOS using pyenv | NatokHD