Python Forum
pip and venv virtual environments
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pip and venv virtual environments
#1
I am looking for some direction for venv virtual environments.

I'm running Python 3.9

If I use virtual environments with venv, I believe by default they will use my system parameters.
If I read the docs correctly, once the environment is created, I need to pip install the extra packages.
Will the new venv look on my system for the packages first, or go download another copy every time?

If I wanted to use something like netmiko, would it need to download everything again each time I create a new venv?

Thanks for any advice.
Sorry if I couldn't find the topic already in the forums.

some of the places I found useful in searching were
https://docs.python.org/3/library/venv.html
https://docs.python.org/3/tutorial/venv.html

Doug
Reply
#2
if you have activated your venv, pip will work from it's site-packages group.
if not activated, will use system.

FYI to activate (Linux): . venvname/bin/activate

if you also use pyenv, you can have different versions of python installed in different virtual environments.
see for more: https://python-forum.io/Thread-pyenv-Sim...Management
soupworks likes this post
Reply
#3
(Dec-28-2020, 10:31 AM)Larz60+ Wrote: if you have activated your venv, pip will work from it's site-packages group.
if not activated, will use system.

FYI to activate (Linux): . venvname/bin/activate

if you also use pyenv, you can have different versions of python installed in different virtual environments.
see for more: https://python-forum.io/Thread-pyenv-Sim...Management

Thank you for the quick response. That helps.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with Windows and Python VENV Pedroski55 2 60 May-11-2026, 10:27 PM
Last Post: Pedroski55
  How to package code for different python environments mayukun 2 1,195 Jul-17-2025, 11:36 AM
Last Post: snippsat
  Venv - Python Virtual Environment on Raspberry Pi DanneA 4 1,870 Jul-02-2025, 05:41 PM
Last Post: Larz60+
  How does venv update $PATH without activating on Windows? bottomfeeder 3 2,316 Mar-13-2025, 01:46 PM
Last Post: DeaD_EyE
  Windows, Linux and virtual environments Calab 2 1,122 Mar-07-2025, 10:43 PM
Last Post: snippsat
  Python use of virtual environments bre67e49 4 1,790 Feb-19-2025, 04:01 AM
Last Post: Sece1967
  JenkinsFile to create a Python venv NikitaMathur 2 3,326 Sep-23-2024, 11:33 AM
Last Post: NikitaMathur
  my venv is not loading njoki 1 3,852 Mar-20-2024, 10:41 AM
Last Post: snippsat
  Best practice on using virtual environments in Python bytecrunch 6 33,654 Feb-14-2024, 03:22 PM
Last Post: snippsat
  Python venv and PIP version issue JanOlvegg 2 6,649 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020