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
  my venv is not loading njoki 1 251 Mar-20-2024, 10:41 AM
Last Post: snippsat
  Best practice on using virtual environments in Python bytecrunch 6 836 Feb-14-2024, 03:22 PM
Last Post: snippsat
  Understanding venv; How do I ensure my python script uses the environment every time? Calab 1 2,267 May-10-2023, 02:13 PM
Last Post: Calab
  Python venv and PIP version issue JanOlvegg 2 1,264 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  Virtual Environments - Organization (VS Code) JaysonWonder 11 1,853 Jan-26-2023, 11:34 PM
Last Post: Larz60+
  Visual Studio Code venv ibm_db error mesi1000 7 2,792 Nov-13-2022, 12:36 AM
Last Post: snippsat
  Keeping up with IDEs and Virtual Environments... bytecrunch 7 2,507 Sep-05-2022, 08:04 PM
Last Post: snippsat
  I don't understand pip and environments snakes 3 1,240 Jul-31-2022, 08:17 PM
Last Post: snakes
  Use different Anaconda environments on Linux Mint and Spyder StaLLoNe_CoBRa 0 1,881 Jan-20-2021, 03:12 AM
Last Post: StaLLoNe_CoBRa
  Not able to set up a virtual environment with venv mohanp06 7 13,799 Oct-27-2020, 12:18 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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