Python
Virtual Environments
10 flashcards · answers and review in the app — launching soon
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?
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?
A teammate clones your project but their venv is empty — none of your dependencies are there. What's the standard way to reproduce your exact package set?
Why is sudo pip install into the system Python for your project's dependencies considered the cardinal venv sin, even though it 'just works'?
venv vs virtualenv vs conda — when does conda give you something the other two can't?