Python · Virtual Environments

Two projects on one machine need different versions of the same library (project A needs Django 3, project B needs Django 5). Why is one system-wide Python a problem, and what fixes it?

Sign in to see the full answer — free to start on the web.

This is one card from the KnowCard library. The full way to learn it — spaced-repetition review, progress tracking, and AI explanations — lives in the KnowCard app, free to start on the web. iOS & Android are coming soon.

Get started — it’s free

Already have an account? Sign in →

More in Virtual Environments

You run python -m venv test_environment and then immediately run python test.py. Which Python and packages does it use — the new environment's, or the system's?
What does activating a virtual environment actually do to your shell?
On Windows the Unix command source myenv/bin/activate doesn't work. What's the correct way to activate the env there?
With an environment active, you run pip install setuptools. Where does the package get installed?
You're done working in an environment and want your shell back to the system Python. What's the right way — and is there a Windows-vs-Unix difference?
How do you permanently delete a virtual environment you no longer need?