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
  How does venv update $PATH without activating on Windows? bottomfeeder 3 746 Mar-13-2025, 01:46 PM
Last Post: DeaD_EyE
  Windows, Linux and virtual environments Calab 2 484 Mar-07-2025, 10:43 PM
Last Post: snippsat
  Python use of virtual environments bre67e49 4 763 Feb-19-2025, 04:01 AM
Last Post: Sece1967
  JenkinsFile to create a Python venv NikitaMathur 2 1,591 Sep-23-2024, 11:33 AM
Last Post: NikitaMathur
  Troubleshooting Jupyter Notebook installation with Python using pip and a venv Drone4four 1 2,180 Jun-04-2024, 10:55 PM
Last Post: Drone4four
  my venv is not loading njoki 1 1,787 Mar-20-2024, 10:41 AM
Last Post: snippsat
  Best practice on using virtual environments in Python bytecrunch 6 14,605 Feb-14-2024, 03:22 PM
Last Post: snippsat
  Python venv and PIP version issue JanOlvegg 2 3,421 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  Virtual Environments - Organization (VS Code) JaysonWonder 11 3,950 Jan-26-2023, 11:34 PM
Last Post: Larz60+
  Visual Studio Code venv ibm_db error mesi1000 7 4,922 Nov-13-2022, 12:36 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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