Skip to content
BENIBIX Learn

Virtual Environment vs Version Manager

People think a virtual environment picks the Python version, and it does not. It keeps the packages of one project apart from the rest. A version manager picks which version of the language runs. Many projects use both: one for Python itself, one for its packages.

Development🛠️ Editors & Tools

Virtual Environment

A folder for one project. It holds the Python code that project needs.

A virtual environment is a folder that holds the Python packages for one project. When it is on, what you install goes into that folder only. So two projects can use two versions of the same package, and both still work. You make one with python3 -m venv .venv, then turn it on before you install anything.

Example
Emma's old project needs an old version of a package, and her new one needs the latest. Each gets its own .venv, and both work.
Why it matters
Without one, all your projects share the same packages. Then an update for one project can break another.
Full entry
Development🛠️ Editors & Tools

Version Manager

A tool that keeps a few versions of a language and lets you switch.

A version manager is a tool that keeps several versions of a language on one computer. It lets you switch between them, for each project or each terminal. nvm does this for Node.js and pyenv does it for Python. A small file in the project can name the version it needs. The manager then picks it for you.

Example
Jack's work app needs an older Node.js, and his own app needs the newest. He runs nvm use in each folder and both work.
Why it matters
Each project may need its own version. Without one, you would have to take the language off and put it back each time.
Full entry

In one line

Virtual Environment
A folder for one project. It holds the Python code that project needs.
Version Manager
A tool that keeps a few versions of a language and lets you switch.