Python Tutorial: virtualenv and why you should use virtual environments

///Python Tutorial: virtualenv and why you should use virtual environments

Python Tutorial: virtualenv and why you should use virtual environments

FavoriteLoadingAdd to favorites

In this video, we will be looking at virtualenv and why you should be using virtual environments in Python. Virtual Environments in Python allow us to keep project-specific dependencies in a separate place than our global site-packages. This is extremely useful when you have different versions of packages for different projects.

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey’s Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:
My Website –
My Second Channel –
Facebook –
Twitter –
Instagram –

#Python

source

By |2019-12-19T00:38:11+00:00December 19th, 2019|Python Video Tutorials|32 Comments

32 Comments

  1. Jaspreet Sahota December 19, 2019 at 12:38 am - Reply

    your videos are so clear! awesome work

  2. cargouvu December 19, 2019 at 12:38 am - Reply

    after executing "virtualenv picar", a "bash:virtualenv command not found" error is coming. How do I fix it?

  3. Reza Rahimi December 19, 2019 at 12:38 am - Reply

    Thank you for your great tutorial!

  4. Matthew O'Brien December 19, 2019 at 12:38 am - Reply

    source project1_env/bin/activate is not working on windows 10. Any help?

  5. krishna budania December 19, 2019 at 12:38 am - Reply

    Thanks for simple and effective explaination

  6. Stephen Devane December 19, 2019 at 12:38 am - Reply

    How do I use a virtualenv in eclipse?

  7. Ilya Starozhyltsev December 19, 2019 at 12:38 am - Reply

    brilliant

  8. CodNet December 19, 2019 at 12:38 am - Reply

    u saved my day!!!!

  9. Rakesh Kumar Kuwar December 19, 2019 at 12:38 am - Reply

    For my windows system, I'm getting this error. Kindly help me out.
    C:UsersamlanEnvironments>project_env/Scripts/activate

    'project_env' is not recognized as an internal or external command,
    operable program or batch file.

    PS: (I've also tried project_env/Scripts/
    activate.bat)

  10. Ashley December 19, 2019 at 12:38 am - Reply

    How come when I create a new virtualenv I get this response `New python executable in /Users/ashley/projects/virtual_environments/pelican/bin/python2.7` I do have 3.7.4 installed, confirmed by running `python -V`. But now inside the virtualenv I get 2.7.15

    I had to run `virtualenv -p python3 pelican` to get the appropriate version in the vm

  11. DEEPAK PRATAP December 19, 2019 at 12:38 am - Reply

    Hi Corey..Thanks for the video
    I wonder if we can create 2 version of python 3 like 3.5 and 3.7 in virtual environment

  12. Luke Yang December 19, 2019 at 12:38 am - Reply

    Hi! I followed along with the video, everything works fine. I am using python3 with version 3.7 on a mac with the newest version. when I "cat requirementstxt", the output is empty. But if i just pip list inside the virtual environment, it does list setuptools, pip, wheel. Can anyone help me with this one?

  13. Iftikhar Abid December 19, 2019 at 12:38 am - Reply

    Schafer i must say, when it comes to python your channel is the best. The way you present is great. I thank you very much for producing python learning videos.

  14. Farzin F December 19, 2019 at 12:38 am - Reply

    how do you compile with virtualenv python3. I think i know how, nevermind

  15. Ebenezer Adama December 19, 2019 at 12:38 am - Reply

    The commands are not working well on Windows

  16. Ebenezer Adama December 19, 2019 at 12:38 am - Reply

    The commands are not working well on Windows

  17. Chris Walker December 19, 2019 at 12:38 am - Reply

    groovy video, it really helped demystify VE for me.

  18. pappireddy rajareddy December 19, 2019 at 12:38 am - Reply

    Hello Corey,
    I am following ur videos and understanding nicel. Can you please help me how to transfer the CSV file from local windows machine to Unix server which is accessible through pulse or Citrix

  19. Marcello Politi December 19, 2019 at 12:38 am - Reply

    Can I move my environment on another computer?

  20. jeff_kaplan December 19, 2019 at 12:38 am - Reply

    when I tried to install it on my home directory I get a "'pip' is not recognized as an internal or external command,

    operable program or batch file." what should I do?

  21. Jonas Mellquist December 19, 2019 at 12:38 am - Reply

    Hi Corey and others..

    When running 'virtualenv env' I'm getting the following permission error.

    Installing collected packages: setuptools, pip, wheel

    ERROR: Could not install packages due to an EnvironmentError.
    Consider using the `–user` option or check the permissions.
    ..
    PermissionError: [Errno 13] Permission denied: '/lib'

    This on the other hand works well:
    python3 -m venv env
    source env/bin/activate

    Also when installing pip3 modules I have to use –user to avoid getting permission errors: 'pip3 install virtualenv –user'

    I found this stack overflow page to be very good in understanding the many different virtual env tools/modules: https://stackoverflow.com/questions/41573587/what-is-the-difference-between-venv-pyvenv-pyenv-virtualenv-virtualenvwrappe

    Edit: This seems to be the 2019 approach https://coreyms.com/development/python/python-tutorial-venv-mac-linux-how-to-use-virtual-environments-with-the-built-in-venv-module – As Corey mentions in the video (from April 2019 he's using the now built in 'venv' instead of 'virtualenv'

  22. #Smiley247 December 19, 2019 at 12:38 am - Reply

    good video. thanks

  23. Clint Robison December 19, 2019 at 12:38 am - Reply

    Judging by your amazon wish list, I think we would get along tremendously!

  24. SuperPoopgoblin December 19, 2019 at 12:38 am - Reply

    ls = dir on windows

  25. Gowtham Prabhu December 19, 2019 at 12:38 am - Reply

    Quick question. If I want to create a deployment package of an application developed in a virtual environment…The only option is to copy the project folders to the site-packages and then export yes?

  26. Sandeep Prasad Kushwaha December 19, 2019 at 12:38 am - Reply

    Please make videos on django-environ

  27. pjesh December 19, 2019 at 12:38 am - Reply

    How do I deploy a script with external modules into a server? I'm struggling on this part.

  28. Matthew Mukalere December 19, 2019 at 12:38 am - Reply

    Very important video – thanks!

  29. Ashwin Sivaraman December 19, 2019 at 12:38 am - Reply

    what is cd !$ do?

  30. Israel Gaytan December 19, 2019 at 12:38 am - Reply

    My friend thanks for share this! Blessings!

  31. Alex Sando December 19, 2019 at 12:38 am - Reply

    So I've made a new virtualenv, what should I do to access it from editor or IDE?

  32. Aymen Lagha December 19, 2019 at 12:38 am - Reply

    02:21 how do I do that on windows

Leave A Comment

*