ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Understanding Virtual Environments for Data Science / Data Analysis - P.4

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ส.ค. 2024
  • Python Fundamentals Course (DataCamp) 👉🏼 lukeb.co/Pytho...
    Data Analyst Track w/ Python (DataCamp) 👉🏼 lukeb.co/Pytho...
    (My recommended courses that I took to learn Python!)
    This video helps understand the basics of virtual environments & package managers that data analysts and scientists will encounter when working with python. We cover simple concepts to start and then work into implementing virtual environments & installing packages with conda (Anaconda). For pip and venv (virtualenv) users, I call out the differences so you can follow along as well.
    Differences of conda v. pip v. virtualenv 👉🏼 docs.conda.io/...
    My playlist for starting Python 👉🏼 • Python Setup
    Download Python w/ Anaconda here 👉🏼 www.anaconda.c...
    Download VS Code here 👉🏼 code.visualstu...
    Certificates & Courses
    ==================================
    Coursera Courses:
    📜 Google Data Analytics Certificate (START HERE) 👉🏼 lukeb.co/Googl...
    💿 SQL for Data Science 👉🏼 lukeb.co/SQLda...
    🧾 Excel Skills for Business 👉🏼 lukeb.co/Excel...
    🐍 Python for Everybody 👉🏼 lukeb.co/Pytho...
    📊 Data Visualization with Tableau 👉🏼 lukeb.co/Table...
    🏴‍☠️ Data Science: Foundations using R 👉🏼 lukeb.co/RforD...
    Coursera Plus Subscription (7-day free trial) 👉🏼 lukeb.co/Cours...
    DataCamp Courses:
    🐍 Python 👉🏼 lukeb.co/Pytho...
    📈 Power BI 👉🏼 lukeb.co/Power...
    📊 Tableau 👉🏼 lukeb.co/Table...
    🏴‍☠️ R 👉🏼 lukeb.co/RData...
    🐍 Data Analyst w/ Python 👉🏼 lukeb.co/Pytho...
    DataCamp Subscription (Monthly $25USD) 👉🏼 lukeb.co/DataC...
    👨🏼‍🏫 All courses 👉🏼 kit.co/lukebar...
    My Tech for Data Science
    (Includes Amazon Affiliate Links)
    ==================================
    💻 Dell New XPS 13 (PC of choice) 👉🏼 geni.us/DellNe...
    💻 Dell New XPS 15 👉🏼 geni.us/DellNe...
    👨🏼‍💻 M1 Macbook Air 8GB (Mac of choice) 👉🏼 geni.us/M1macA...
    👨🏼‍💻 M1 Macbook Pro 8GB 👉🏼 geni.us/M1macP...
    🔌 Must-have Mac dock 👉🏼 geni.us/CalDig...
    🖥 M1 Multiple monitor adapter 👉🏼 geni.us/Displa...
    ⌨️ Mac Keyboard 👉🏼 geni.us/MacMag...
    🖱 Mac Mouse 👉🏼 geni.us/MacMag...
    💾 Small (1TB) External HD 👉🏼 geni.us/WDelem...
    💾 Large (14TB) External HD 👉🏼 geni.us/WDelem...
    🏢 Standing Desk 👉🏼 geni.us/Standi...
    📗 Data Science Must Read 👉🏼 geni.us/Storyt...
    📸 Camera of Choice 👉🏼 geni.us/SonyA6...
    For computers, I recommend checking the manufacturer's website (i.e., dell.com) for deals/rebates
    Social Media / Contact Me
    ======================
    🙋🏼‍♂️Website: www.lukebarous...
    🌄 Instagram: / lukebarousse
    ⏰ TikTok: / lukebarousse
    📘 Facebook: / datavizbyluke
    📥 Business Inquiries: luke@lukebarousse.com
    As an Amazon Associate, I earn a small commission from qualifying purchases on the Amazon links above. It costs you nothing but helps me in keeping the content coming.
    00:00 Intro
    01:14 The need for packages & managers
    03:28 Using packages & package managers (coding example)
    07:34 The problem virtual environments solve
    09:32 Showing the problem (coding example)
    12:35 The concept of virtual environments
    14:40 Using virtual environments (coding example)
    18:39 Conclusion
    #vscode #pythontutorial #datavisualization

ความคิดเห็น • 96

  • @mikewaters6980
    @mikewaters6980 2 ปีที่แล้ว +3

    Best 20 mins spent all day! Thanks Luke, you managed to make it crystall clear.

  • @daniloamchagas
    @daniloamchagas 3 ปีที่แล้ว +11

    Great explanation, man! I've been watching some of your videos and they're great! Very informative and with a simple approach. Congratulations for your good work!

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว +2

      Heck yeah! 🙌🏼🤙🏼 Thanks for the kind words Danilo, they are much appreciated! Comments like these keep me pumping out more content!

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      @Aditya Wagh Thanks my dude! Just trying to keep it interesting!!
      Def appreciate the suggested topics. Let me see what I can do for ya, hope I can make it happen this year! Stay tuned!

  • @dp6736
    @dp6736 ปีที่แล้ว +2

    This is great. I was getting confuse between venv and conda. You helped me a lot. Thanks.

  • @bradleyfrueh2761
    @bradleyfrueh2761 2 ปีที่แล้ว +2

    Thank you not nerding out too hard in the explanations. I just want to get started! I can learn the rest later. Bless you

  • @machyman2495
    @machyman2495 3 ปีที่แล้ว +2

    Luke, this series is so awesome. Been trying to figure out how best to setup anaconda and virtual environments and this is by far the clearest and best guide. I just had two quick Qs: 1) in your terminal and the .py files stuff pops up so you can autocomplete what you are typing; how do I set that up? 2) My terminal is the power shell whereas yours has the environment in parentheses and the dollar sign at the end; how do I get that setup? Thanks again for these amazing videos!

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      Mac, thanks for the kind words! So glad that this tutorial has been helpful for you!
      1) For the autocomplete I installed an add-in that does this and is specific to the mac terminals, since you are using Powershell I found this option, but there may be better options: dev.to/ofhouse/add-a-bash-like-autocomplete-to-your-powershell-4257
      2) This is a custom ZSH theme that is specific to mac (& linux) terminals (theme: PowerLevel10K). For powershell you'll need to set up powerline (which is a similar theme) to customize how the terminal looks (You won't be able to get it exactly the same as mine, but you can customize to pretty close). Here is a link & vid on how to set this up: docs.microsoft.com/en-us/windows/terminal/tutorials/powerline-setup

  • @Vanderposh
    @Vanderposh ปีที่แล้ว +1

    Luuuuuuke ❤I am revisiting these videos after initially watching them a couple of years ago when they first came out, and it’s still one of the best tutorials! You have made everything so accessible and easy to grasp. Your videos are excellent supplementary side information I am using as a graduate student in data science program 🎉

    • @LukeBarousse
      @LukeBarousse  ปีที่แล้ว

      Heck yeah! Glad that you are getting use out of these videos still!

  • @PaxSanguina
    @PaxSanguina 3 ปีที่แล้ว +1

    Systematically amazing video.. I've been watching and practicing every single step (from installing anaconda). I will continue watch this video tomorrow. I am new to python. So I will savour my moment of learning it. Once again, thank you!!

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว +1

      This is awesome to hear!! Keep up the hard work Bagaskoro!!

    • @PaxSanguina
      @PaxSanguina 3 ปีที่แล้ว

      @@LukeBarousse thanks.. really appreciate it

  • @sandhyaavasthi2468
    @sandhyaavasthi2468 ปีที่แล้ว

    well explained, i understand fully now, why we need virtual envrionment, great

  • @Alex-gw6pm
    @Alex-gw6pm ปีที่แล้ว +1

    Very great job!! Thanks a lot for your content, very useful and detailed explanation 👍🏻👍🏻👍🏻👍🏻

  • @msizikhanyile3667
    @msizikhanyile3667 2 ปีที่แล้ว

    Thanks Luke, this really helped me in installing statsmodels library into python and VS code env. Now I understand how to work efficiently in VS Code

    • @LukeBarousse
      @LukeBarousse  2 ปีที่แล้ว

      Heck yeah, so glad this tutorial helped Msizi!

  • @joycwang
    @joycwang 3 ปีที่แล้ว

    thank you best video I've seen so far to explain why and how to set up virtual environment

  • @Digital-Light
    @Digital-Light ปีที่แล้ว

    i loved this video , thank you!

  • @anthony7527
    @anthony7527 3 ปีที่แล้ว

    This video series was a great help, very much appreciated!

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      Awe thanks Anthony! I appreciate it!

  • @rezagh5438
    @rezagh5438 ปีที่แล้ว

    I wish I could like it multiple times!!!

  • @mohamedawnallah2957
    @mohamedawnallah2957 2 ปีที่แล้ว

    Fantastic! Keep pumping out more content!

    • @LukeBarousse
      @LukeBarousse  2 ปีที่แล้ว

      More to come, Mohamed! Thanks 🙌🏼

  • @thanarttangtanakoon2993
    @thanarttangtanakoon2993 3 ปีที่แล้ว

    Wow. The explanation is very clear !! Thanks.

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      Awe thank you so much Thanart!!

  • @mosampatel7059
    @mosampatel7059 ปีที่แล้ว

    Wow! Great explanation!

  • @TheAjKurt
    @TheAjKurt 3 ปีที่แล้ว

    Amazing work Luke. All you videos have excellent explanation with perfect visualization. Keep on going (y)

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      Alexandre, thanks so much for this!! I'm glad you found this helpful! More to come!🤙🏼

  • @sucharithaanumula1849
    @sucharithaanumula1849 2 ปีที่แล้ว

    Awesome explanation

  • @fabrizziorutigliano1924
    @fabrizziorutigliano1924 3 ปีที่แล้ว

    Very neat explanation, subscribed!

  • @003kazimehrabrashid4
    @003kazimehrabrashid4 ปีที่แล้ว

    The way you talk and your visualization is simply awesome. The only confusion that i got is do i need to create virtual environment for every code that i am gonna write? What if I didn't create any virtual environment and got into this issue , will it be fixable then ?

    • @LukeBarousse
      @LukeBarousse  ปีที่แล้ว +1

      Thank you! And you should make an environment for every project. One project may have multiple python files that can use the same environment. But if i'm changes projects I create a new environment.

  • @Heczky
    @Heczky 6 หลายเดือนก่อน

    After activating venv2, don't we need to change Python interpreter too?
    I mean, for running venv2, interpreter for 3.6.12 (venv1) was enough, it seems, just asking if it could be a problem in som cases..
    Anyway thanks for great explanation, I'm actually deciding between pip and conda, which could be better, but I will probably go for conda as I plan to advance from Data Engineering to Data Analytics in a fee months..
    Good luck Luke!

  • @suparnaprasad8187
    @suparnaprasad8187 ปีที่แล้ว

    Great video - super helpful! But I'm unable to see the version of python running, and info about which virtual envt I'm in, can anyone please help?

  • @abdoaboellil2798
    @abdoaboellil2798 ปีที่แล้ว

    Great work, thanks

  • @rubenabrahamparedesjimenez5148
    @rubenabrahamparedesjimenez5148 2 ปีที่แล้ว

    Great video, thanks

  • @gabrielgudino9357
    @gabrielgudino9357 2 ปีที่แล้ว

    That was a lot of help! Thanks a lot!!

    • @LukeBarousse
      @LukeBarousse  2 ปีที่แล้ว +1

      Glad it was helpful, Gabriel!

  • @crypto_peng
    @crypto_peng 3 ปีที่แล้ว

    clearly in the topics will have, also, this is what I want! Thanks.

    • @crypto_peng
      @crypto_peng 3 ปีที่แล้ว

      I like 2a part, nice

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      Thanks for the kind words! Glad you enjoyed!!

  • @DIGITAL_COOKING
    @DIGITAL_COOKING 2 ปีที่แล้ว

    great series !!! 👍👍👍

  • @ANAND02120
    @ANAND02120 ปีที่แล้ว

    Can we conclude that Virtual enviroment is like writing latex file(tex) with all the package used called or listed in the top of the file. So for virtual enviorment we install all the particular package version require for that file?

  • @khanhtruong3254
    @khanhtruong3254 2 ปีที่แล้ว

    Hey Luke. You did great job on putting yourself on python starters' shoes. The series is just awesome. Thank you so much.
    Just one question: at 15:50 you said we need to restart the VS Code so that we're able to select the new installed virtual environment. But you didn't restart from the creation of "ven2", just needed to "conda activate venv2" in the command line (the Python interpreter still remains "venv1" at the left down conner).
    So it's important to select environment in the command line. Why do we even bother about the Python interpreter of VS Code at the left down conner?

    • @LukeBarousse
      @LukeBarousse  2 ปีที่แล้ว

      So that restart thing has been fixed... you don't need to restart anymore to select the environment for the jupyter notebook... For the command line, you never needed to restart

  • @yasir134
    @yasir134 11 หลายเดือนก่อน

    hey Luke, I'm learning datascience but stuck with some sandbox online env in browser. Turicreate needs python 3.7, i created env with pip, conda, pipx but while installing turicreate it return with error "upgrade pip or problem with package.
    Please make tutorial for that, much appreciated

  • @Chilunem
    @Chilunem 24 วันที่ผ่านมา

    when I try to install numpy it doesn't work it says conda is not defined what do I do
    @Luke

  • @peaceazugo927
    @peaceazugo927 2 ปีที่แล้ว

    Thanks

  • @003kazimehrabrashid4
    @003kazimehrabrashid4 ปีที่แล้ว

    So the thing is as long as i am not updating any module in pip or conda, it should be working fine in global environment without creating any virtual environment. am i right?

    • @LukeBarousse
      @LukeBarousse  ปีที่แล้ว +1

      Yes, for very simple python scripts that you will never have to use again... but I highly recommend creating environments as it will save you when you come back to run a python script years from now and you have the correct environment ready to go

  • @Mhziko
    @Mhziko 2 ปีที่แล้ว

    Anaconda never works on my machine, exhausted all the troubleshooting. Would you please recommend an alternative? Thanks

    • @LukeBarousse
      @LukeBarousse  2 ปีที่แล้ว +1

      Really?! That's very strange, I've never had issues like this before. I'd go with using pip then; it's just as good

  • @prathamsethi9892
    @prathamsethi9892 3 ปีที่แล้ว

    Great Job Luke. I've been following this playlist and so far its going great. Just one ques though, math code works fine. But, numpy is not working for me. when I tried installing it the output came 'already installed'

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว +1

      Hey Pratham, thanks for following along and for the kind words! Regarding the file, I didn't show this part but I created the file_1.py and saved it to my desktop. You can create the file a number of different ways. I recommend using the terminal: 1) Navigate into the folder where you want to save the file (cd Desktop) 2. Create the file (touch file_1.py)

    • @prathamsethi9892
      @prathamsethi9892 3 ปีที่แล้ว

      @@LukeBarousse Thanks for the quick response. I tried following your instructions but terminal responds- "SyntaxError: invalid syntax"

    • @prathamsethi9892
      @prathamsethi9892 3 ปีที่แล้ว

      raise AttributeError("module {!r} has no attribute "
      AttributeError: module 'numpy' has no attribute 'arrange'

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว +1

      @@prathamsethi9892 What terminal are you using? if mac, all you need to do is open terminal, type "cd Desktop" then "touch file_1.py"
      the numpy error is very strange, I'm not sure how you are getting that.

  • @monarch2397
    @monarch2397 2 ปีที่แล้ว +1

    guys ... i have a problenm i alr install the numpy module but when i run it says no module found but when i install it again it says the module has been downloaded ..what shoul i do?

    • @LukeBarousse
      @LukeBarousse  ปีที่แล้ว

      It sounds like you aren't in the right environment

    • @monarch2397
      @monarch2397 ปีที่แล้ว

      @@LukeBarousse if i use conda/anaconda, maybe i should'nt download the python languange? Or its not the problem?

    • @LukeBarousse
      @LukeBarousse  ปีที่แล้ว

      @@monarch2397 I don't think that's the problem. Its the environment your terminal is in. You have to make sure you activated the environment.

    • @monarch2397
      @monarch2397 ปีที่แล้ว

      @@LukeBarousse is it conda activated venv1 ? I alr use it and nothing happened...idk but urs seem kinda diff u have the smth like (base1) or (venv1). Mine doesnt like that and i wonder why?

  • @andrescifuentes5729
    @andrescifuentes5729 3 ปีที่แล้ว

    Hi Luke. I'm a beginner in this world of programming languages and Data World and your videos are helping me a lot! but i'm having a huge troubles with the virtual environments . I did every single step you did in your videos of installing python, anaconda and VS code. everything seems to be perfect. I write the code to create the new environment and it runs well but... when I try to activate it does nothing. literally nothing. Don't put error, does not activate it and I don't know what to do now

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      I've never experienced this issue before. What terminal are you running this in?

    • @andrescifuentes5729
      @andrescifuentes5729 3 ปีที่แล้ว

      ​@@LukeBarousse Vs code shows me by default automatic, the powershell terminal, I have tried there and it does not work and the same error in the python terminal. I don't know if there is a conda terminal that I should open and how to open it, could it be that?

  • @PabloDini
    @PabloDini 3 ปีที่แล้ว

    Hi everybody, i have already installed numpy but keep me saying " ModuleNotFoundError: No module named 'numpy' " , if I go to "Run" then "Run without debugging" work just fine .I don't know why

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว +1

      Hey Pablo, it sounds like you are not in the correct environment for your jupyter notebook. You need to change the environment to be in the same one that you installed numpy.

  • @vishalkhombare
    @vishalkhombare ปีที่แล้ว

    Can we not write ( say in the comments) in the beginning of the code itself the list of packages with their versions we used when created and ran the code successfully. This way if we transfer this our friend or say a teacher to 50 students, then can use this list in anytime in future to create the specific virtual env to run that code. Am I talking correct here? Or is there any other way to manage this?

    • @LukeBarousse
      @LukeBarousse  ปีที่แล้ว +1

      Thats a great question, there actually is a more common way to manage this.
      In python projects, you can recored the versions of your packages to a 'requirements.txt' file. Conda or pip as code to do this. Then if someone loads your code on their computer they just use the requirements.txt file to load the required versions of the packages when creating their virtual environment on their computer! It's actually a pretty cool concept

  • @shinaken
    @shinaken ปีที่แล้ว

    Hi Luke, when I try to run Python in the cmd I get the message: "This Python interpreter is in a conda environment, but the environment has
    not been activated. Libraries may fail to load.". I'm not exactly sure what this means or how to fix this.

    • @LukeBarousse
      @LukeBarousse  ปีที่แล้ว

      The error message tells you that the Python interpreter from the Conda environment was found, but that 'conda activate ' has not been called. So you need to activate the enviornment

    • @shinaken
      @shinaken ปีที่แล้ว

      @@LukeBarousse Thanks Luke, do you have to activate this each time you open and? I didn't see you do this in the video.

  • @bhargavram7364
    @bhargavram7364 3 ปีที่แล้ว

    Hey Luke please give me a solution for this, I am using Windows 10
    from numpy.core._multiarray_umath import (
    ImportError: DLL load failed: The specified module could not be found.

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      I don't think I have enough details. Have you tried googling your answer to see if something pops up?

  • @eddiebrito4515
    @eddiebrito4515 2 ปีที่แล้ว

    Hello Luke, I am new to programing and want to expand my knowledge. I have followed your previous vids and installed everything correctly. Until this vid. My terminal looks different as you are using a mac. In the previous vids you showed how to do both platforms. Can you please explain how to do it for win 10. I would try to install "conda instal numpy==/1.17" with no luck in the python terminal. the terminal I am using doesn't generate the "$" symbol for me or have the different colors. Thanks for the help.

    • @LukeBarousse
      @LukeBarousse  2 ปีที่แล้ว

      Hey Eddie, you don't need to worry about the $ symbol. Thats just the standard symbol on the mac. Let me see what I can do for a windows tutorial, but overall the command should be the same

    • @eddiebrito4515
      @eddiebrito4515 2 ปีที่แล้ว

      @@LukeBarousse thanks, I'll post a pic of the message I am receiving tomorrow morning central time.

  • @jenstoftknudsen8407
    @jenstoftknudsen8407 3 ปีที่แล้ว

    Hey Luke, great videos
    My Terminal looks different than yours (did the same as you regarding installation etc.) but you terminal says 2:python, whereas i can only choose powershell og cmd, how do i get the same option as you, for instance my terminal doesn't show which virtual environment i am in if i use Powershell or if it is cmd it shows which virtual environment but i can't use clear for example.
    Is there anyway i can make it like yours?
    Kind regards
    Jens

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      It's a little bitter harder as I think you are on a Windows machine. You won't beable to do exactly the same as me. Here is an article that may be a good start: medium.com/@hjgraca/style-your-windows-terminal-and-wsl2-like-a-pro-9a2e1ad4c9d0

    • @jenstoftknudsen8407
      @jenstoftknudsen8407 3 ปีที่แล้ว

      @@LukeBarousse Ah of course, I will definitely read through your link, it looks promising. Thank you for a quick answer and for making great content!

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      @@jenstoftknudsen8407 Thanks so much Jens!

  • @elibainbridge1326
    @elibainbridge1326 ปีที่แล้ว

    I never understood what the -m option does in: 'python -m venv my_virtualbox'

  • @zakeyaalsada616
    @zakeyaalsada616 3 ปีที่แล้ว

    Hi, I asked a question on another post, but then I came here. So, I downloaded anaconda on my Mac, but do I need to add a conda extension to my VS code?

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว +1

      Hi Zakeya, the only extension that is required is the python one I point out in the next video (p.5). There is a conda extension but it is not necessary. Let me know if you have any other questions!

    • @zakeyaalsada616
      @zakeyaalsada616 3 ปีที่แล้ว

      @@LukeBarousse Thank you for your prompt response. I truly appreciate it. I am new to this, so my questions could be basic. The thing is that when I follow the steps in this video and reach the part where I have to install numpy it gives me this error: bash: conda: command not found

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว

      @@zakeyaalsada616 No problem! To help troubleshoot, are you using Mac or WIndows? The problem is that the "conda" command was not added to be used in your Terminal/Command Prompt. For windows, if during the Anaconda setup you didn't select to add "conda" to path this would cause this.

  • @yevgeniybondar7509
    @yevgeniybondar7509 2 ปีที่แล้ว

    like

  • @laugedyret
    @laugedyret 3 ปีที่แล้ว

    The blue popup information you create is very distracting. Otherwise a great video!

    • @LukeBarousse
      @LukeBarousse  3 ปีที่แล้ว +1

      Good to know! I didn't realize this.. so thanks for sharing this!