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

  Рет қаралды 42,781

Luke Barousse

Luke Barousse

Күн бұрын

Python Fundamentals Course (DataCamp) 👉🏼 lukeb.co/PythonBasicsDataCamp
Data Analyst Track w/ Python (DataCamp) 👉🏼 lukeb.co/PythonAnalystDataCamp
(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/projects/conda/...
My playlist for starting Python 👉🏼 • Python Setup
Download Python w/ Anaconda here 👉🏼 www.anaconda.com/products/ind...
Download VS Code here 👉🏼 code.visualstudio.com/download
Certificates & Courses
==================================
Coursera Courses:
📜 Google Data Analytics Certificate (START HERE) 👉🏼 lukeb.co/GoogleCert
💿 SQL for Data Science 👉🏼 lukeb.co/SQLdataScience
🧾 Excel Skills for Business 👉🏼 lukeb.co/ExcelBusinessAnalyst
🐍 Python for Everybody 👉🏼 lukeb.co/PythonForEverybody
📊 Data Visualization with Tableau 👉🏼 lukeb.co/Tableau_UCDavis
🏴‍☠️ Data Science: Foundations using R 👉🏼 lukeb.co/RforDataScienceJH
Coursera Plus Subscription (7-day free trial) 👉🏼 lukeb.co/CourseraPlus
DataCamp Courses:
🐍 Python 👉🏼 lukeb.co/PythonBasicsDataCamp
📈 Power BI 👉🏼 lukeb.co/PowerBIDataCamp
📊 Tableau 👉🏼 lukeb.co/TableauDataCamp
🏴‍☠️ R 👉🏼 lukeb.co/RDataCamp
🐍 Data Analyst w/ Python 👉🏼 lukeb.co/PythonAnalystDataCamp
DataCamp Subscription (Monthly $25USD) 👉🏼 lukeb.co/DataCampSub
👨🏼‍🏫 All courses 👉🏼 kit.co/lukebarousse/data-anal...
My Tech for Data Science
(Includes Amazon Affiliate Links)
==================================
💻 Dell New XPS 13 (PC of choice) 👉🏼 geni.us/DellNewXPS13
💻 Dell New XPS 15 👉🏼 geni.us/DellNewXPS15
👨🏼‍💻 M1 Macbook Air 8GB (Mac of choice) 👉🏼 geni.us/M1macAir8GB
👨🏼‍💻 M1 Macbook Pro 8GB 👉🏼 geni.us/M1macPro8GB
🔌 Must-have Mac dock 👉🏼 geni.us/CalDigitTS3
🖥 M1 Multiple monitor adapter 👉🏼 geni.us/DisplayLinkAdapter
⌨️ Mac Keyboard 👉🏼 geni.us/MacMagicKeyboard
🖱 Mac Mouse 👉🏼 geni.us/MacMagicMouse
💾 Small (1TB) External HD 👉🏼 geni.us/WDelements1TB
💾 Large (14TB) External HD 👉🏼 geni.us/WDelements14TB
🏢 Standing Desk 👉🏼 geni.us/StandingDeskFezibo
📗 Data Science Must Read 👉🏼 geni.us/StorytellingWithData
📸 Camera of Choice 👉🏼 geni.us/SonyA6600body
For computers, I recommend checking the manufacturer's website (i.e., dell.com) for deals/rebates
Social Media / Contact Me
======================
🙋🏼‍♂️Website: www.lukebarousse.com/
🌄 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

Пікірлер: 95
@mikewaters6980
@mikewaters6980 Жыл бұрын
Best 20 mins spent all day! Thanks Luke, you managed to make it crystall clear.
@bradleyfrueh2761
@bradleyfrueh2761 Жыл бұрын
Thank you not nerding out too hard in the explanations. I just want to get started! I can learn the rest later. Bless you
@dp6736
@dp6736 Жыл бұрын
This is great. I was getting confuse between venv and conda. You helped me a lot. Thanks.
@Alex-gw6pm
@Alex-gw6pm Жыл бұрын
Very great job!! Thanks a lot for your content, very useful and detailed explanation 👍🏻👍🏻👍🏻👍🏻
@daniloamchagas
@daniloamchagas 3 жыл бұрын
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 жыл бұрын
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!
@sandhyaavasthi2468
@sandhyaavasthi2468 Жыл бұрын
well explained, i understand fully now, why we need virtual envrionment, great
@anthony7527
@anthony7527 3 жыл бұрын
This video series was a great help, very much appreciated!
@LukeBarousse
@LukeBarousse 3 жыл бұрын
Awe thanks Anthony! I appreciate it!
@Digital-Light
@Digital-Light Жыл бұрын
i loved this video , thank you!
@abdoaboellil2798
@abdoaboellil2798 Жыл бұрын
Great work, thanks
@Vanderposh
@Vanderposh Жыл бұрын
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!
@mosampatel7059
@mosampatel7059 Жыл бұрын
Wow! Great explanation!
@rubenabrahamparedesjimenez5148
@rubenabrahamparedesjimenez5148 Жыл бұрын
Great video, thanks
@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!
@thanarttangtanakoon2993
@thanarttangtanakoon2993 3 жыл бұрын
Wow. The explanation is very clear !! Thanks.
@LukeBarousse
@LukeBarousse 3 жыл бұрын
Awe thank you so much Thanart!!
@DIGITAL_COOKING
@DIGITAL_COOKING Жыл бұрын
great series !!! 👍👍👍
@sucharithaanumula1849
@sucharithaanumula1849 Жыл бұрын
Awesome 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!🤙🏼
@joycwang
@joycwang 2 жыл бұрын
thank you best video I've seen so far to explain why and how to set up virtual environment
@LukeBarousse
@LukeBarousse 2 жыл бұрын
Awe thanks Jia!!!
@mohamedawnallah2957
@mohamedawnallah2957 2 жыл бұрын
Fantastic! Keep pumping out more content!
@LukeBarousse
@LukeBarousse 2 жыл бұрын
More to come, Mohamed! Thanks 🙌🏼
@rezagh5438
@rezagh5438 10 ай бұрын
I wish I could like it multiple times!!!
@PaxSanguina
@PaxSanguina 3 жыл бұрын
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 жыл бұрын
This is awesome to hear!! Keep up the hard work Bagaskoro!!
@PaxSanguina
@PaxSanguina 3 жыл бұрын
@@LukeBarousse thanks.. really appreciate it
@fabrizziorutigliano1924
@fabrizziorutigliano1924 3 жыл бұрын
Very neat explanation, subscribed!
@LukeBarousse
@LukeBarousse 3 жыл бұрын
Thank you Fabrizzio!
@gabrielgudino9357
@gabrielgudino9357 2 жыл бұрын
That was a lot of help! Thanks a lot!!
@LukeBarousse
@LukeBarousse 2 жыл бұрын
Glad it was helpful, Gabriel!
@machyman2495
@machyman2495 3 жыл бұрын
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
@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!!
@peaceazugo927
@peaceazugo927 Жыл бұрын
Thanks
@suparnaprasad8187
@suparnaprasad8187 10 ай бұрын
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?
@Heczky
@Heczky 4 ай бұрын
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!
@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 Жыл бұрын
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.
@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 9 ай бұрын
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
@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 жыл бұрын
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 жыл бұрын
@@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.
@jenstoftknudsen8407
@jenstoftknudsen8407 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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 2 жыл бұрын
@@jenstoftknudsen8407 Thanks so much Jens!
@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.
@Mhziko
@Mhziko 2 жыл бұрын
Anaconda never works on my machine, exhausted all the troubleshooting. Would you please recommend an alternative? Thanks
@LukeBarousse
@LukeBarousse 2 жыл бұрын
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
@andrescifuentes5729
@andrescifuentes5729 2 жыл бұрын
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 2 жыл бұрын
I've never experienced this issue before. What terminal are you running this in?
@andrescifuentes5729
@andrescifuentes5729 2 жыл бұрын
​@@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?
@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?
@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 жыл бұрын
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.
@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 Жыл бұрын
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
@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 Жыл бұрын
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
@monarch2397
@monarch2397 Жыл бұрын
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?
@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.
@PabloDini
@PabloDini 2 жыл бұрын
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 2 жыл бұрын
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.
@elibainbridge1326
@elibainbridge1326 Жыл бұрын
I never understood what the -m option does in: 'python -m venv my_virtualbox'
@yevgeniybondar7509
@yevgeniybondar7509 2 жыл бұрын
like
@LukeBarousse
@LukeBarousse 2 жыл бұрын
thanks!
@laugedyret
@laugedyret 2 жыл бұрын
The blue popup information you create is very distracting. Otherwise a great video!
@LukeBarousse
@LukeBarousse 2 жыл бұрын
Good to know! I didn't realize this.. so thanks for sharing this!
Using VS Code with Python for Data Science / Data Analysis - P.5
28:03
Anaconda (Conda) for Python - What & Why?
26:10
Academind
Рет қаралды 218 М.
Whyyyy? 😭 #shorts by Leisi Crazy
00:16
Leisi Crazy
Рет қаралды 20 МЛН
FOOLED THE GUARD🤢
00:54
INO
Рет қаралды 51 МЛН
Please be kind🙏
00:34
ISSEI / いっせい
Рет қаралды 82 МЛН
Exploratory Data Analysis with Pandas Python
40:22
Rob Mulla
Рет қаралды 429 М.
Top Apps I Use as a Data Analyst
16:39
Luke Barousse
Рет қаралды 35 М.
How to Set up VS Code for Data Science & AI
22:53
Dave Ebbelaar
Рет қаралды 271 М.
How I use SQL as a Data Analyst
15:30
Luke Barousse
Рет қаралды 802 М.
🚨 YOU'RE VISUALIZING YOUR DATA WRONG. And Here's Why...
17:11
Adam Finer - Learn BI Online
Рет қаралды 22 М.
virtualenv vs. venv (beginner - intermediate) anthony explains #040
11:22
anthonywritescode
Рет қаралды 40 М.
How I'd Learn to be a Data Analyst in 2024
13:17
Luke Barousse
Рет қаралды 234 М.
Гимнастика или танцы, что круче? #shorts
1:00
Виталий Смирнов
Рет қаралды 1,2 МЛН
Fall !! sharing ch0copie with ants #short #antseating
0:15
The Shaka Hunt
Рет қаралды 13 МЛН
Пена из арбуза 🤯
0:25
FATA MORGANA
Рет қаралды 2,7 МЛН
Please subscribe!!
0:19
なべの口呼吸な生活
Рет қаралды 5 МЛН