💻
Python Zero to Hero
  • Python Zero to Hero
  • What is Python?
    • What is Python?
      • High Level
      • Intrepreted
      • General Purpose
    • Tooling
    • Hello, World!
    • Variables
    • Operators
    • Object Orientated Programming
    • Boolean Values
    • If Statements
    • Loops
    • Functions
      • Scope
    • Python Libraries
    • Virtual Environments
      • PyEnv
  • Advanced
    • Introduction
    • Set Theory
Powered by GitBook
On this page

Was this helpful?

  1. What is Python?
  2. Virtual Environments

PyEnv

PreviousVirtual EnvironmentsNextIntroduction

Last updated 4 years ago

Was this helpful?

PyEnv is a tool that let's us switch between multiple versions of Python easily.

Note: PyEnv does not support Windows.

To install PyEnv, run:

curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash

Taken from here

Now let's install 3.7

pyenv install 3.7.0

We can use PyEnv locally or globally.

Globally means we change our entire Python version on our computer. Locally means that for a specific project or directory we use a different Python version.

In our my-new-project directory, run pyenv local 3.7.0.

And just like that we can use different Python versions for different things.

If we wanted to use 3.7.0 globally instead of 3.8:

pyenv global 3.7.0
https://github.com/pyenv/pyenv