How to use a Python Virtual Environment the RIGHT way with Jupyter Notebook

Поделиться
HTML-код
  • Опубликовано: 3 янв 2025

Комментарии • 43

  • @ellenk8447
    @ellenk8447 4 года назад +1

    This is perfect! Exactly what I needed. When I made the virtual environment using venv instead of virtualenv, I couldn't for the life of me install the kernel in my virtual environment. This solved that problem perfectly. Thank you!!

  • @chrisfx9097
    @chrisfx9097 2 года назад +1

    OMG!!! thank you very much
    initially, i used python3 -m venv "name of enviroment" and anytime i launched jupyter notebook, i wouldn't see my created enviroment
    but using virtualenv instead worked for me

  • @vikasreddy8326
    @vikasreddy8326 Год назад

    Crisp and to the point

  • @chandrakalagowda3129
    @chandrakalagowda3129 Год назад

    Thank you.!

  • @learner_academy
    @learner_academy 4 года назад +4

    also include pip3 install ipykernel

  • @aldolunabueno2634
    @aldolunabueno2634 6 месяцев назад

    And how can you make venv the default in Jupyter instead of Python 3?

  • @sajjadalizade2212
    @sajjadalizade2212 4 года назад +1

    thank you bro you solved my problem

  • @TrevorHigbee
    @TrevorHigbee 3 года назад

    Just what I needed! Thank you!

  • @sasha_piter_17
    @sasha_piter_17 4 года назад +4

    Hi, you have a great way of explaining!
    I followed all the steps but unfortunately, it still does not work! Don't manage to get a virtual environment with the older version of pandas, still stays the most updated one. Would be awesome if you could help, I really want to get it.
    Any suggestions?
    Btw, really great videos that you make.

    • @SATSifaction
      @SATSifaction  4 года назад

      It would depend on which IDE you use

  •  2 года назад

    Super!

  • @harshavardhan9991
    @harshavardhan9991 4 года назад

    Thank you !! You have installed lot of chrome extensions :)

    • @SATSifaction
      @SATSifaction  4 года назад +1

      I do like chrome over safari 🙂

  • @jrnmadsen2710
    @jrnmadsen2710 4 года назад +1

    Hi, great tutorial. Thanks.
    One more thing,- if I wanna use the environment env for handling data,- downloaded to the "real" OS, how do I handle that?

    • @SATSifaction
      @SATSifaction  4 года назад +1

      You maybe looking at containerizing the solution then using something like docker. Check this out -> Why You Need to Containerize Machine Learning Models ruclips.net/video/7-7p6WuDtbs/видео.html

    • @jrnmadsen2710
      @jrnmadsen2710 4 года назад

      @@SATSifaction Great idea,- thanks. I'll give it a shot. Perhaps more agile than an Anaconda environment.

  • @sidhantmathur6716
    @sidhantmathur6716 3 года назад

    I was able to install the virtual env, but for some reason jupyter notebook is not able to connect to the kernel. Any suggestions on what i could do?

    • @SATSifaction
      @SATSifaction  3 года назад

      When you open jupyter try to set up a new notebook instance and if you setup the virtual env correct it should pop up on the top right.

  • @ГригорийМороз-о5н
    @ГригорийМороз-о5н 2 года назад

    Seems like it doesn't work for windows.
    The kernel is intalling is some default folder "C:\Users\USER\AppData\Roaming\jupyter\kernels\venv", and the python executable path stays the same =(

  • @ermomusic
    @ermomusic 4 года назад

    I imagine this kernel thing is usable in all IdE?

    • @SATSifaction
      @SATSifaction  4 года назад

      If you mean in virtual environment then yes in most

  • @manojtiwari7754
    @manojtiwari7754 5 лет назад

    Hey.. sats I was trying to do this last month and I have a Windows PC.. I did whatever you showed here.. but it wasn't working!! Can you please help or make another video showing the same setup.. please!! Btw you're awesome buddy.. I'm following ur vids religiously

    • @SATSifaction
      @SATSifaction  5 лет назад

      Thank you. 🙏 . So you want to see a windows version of this? It’s very similar

    • @manojtiwari7754
      @manojtiwari7754 5 лет назад

      @@SATSifaction yes!! It's very similar.. but idk why.. it wasn't working when I set it up on my PC

    • @danielbaena4691
      @danielbaena4691 4 года назад +2

      The only step that is different is when you create your virtual env. On windows you can create it with : python -m venv venv
      And then, to access to the venv: venv\Scripts\activate.bat

  • @loudencm
    @loudencm 4 года назад

    Not sure what is going on. I was able to follow all the steps and I have my venv Jupiter but it is giving me the system pandas and not the venv version...

    • @SATSifaction
      @SATSifaction  4 года назад

      Are you logged in your virtual env?

    • @loudencm
      @loudencm 4 года назад

      @@SATSifaction I am in venv in both the directory in terminal ((venv) appears to the left of the command prompt) and the Jupiter notebook that I opened from that location (it says venv in top right). I have re initiated all the steps various times from scratch in case I did something wrong...but still same results.

    • @fabien7363
      @fabien7363 3 года назад

      @@loudencm I get exactly the same. All steps worked, but when I try to import a package that I installed in my venv, I still can't import it. Have you found the solution?

    • @loudencm
      @loudencm 3 года назад +5

      ​@@fabien7363 Yes, I think in the end I was missing a step because order is very important.
      1) virtualenv -p python3 .venv
      2) source .venv/bin/activate
      3) pip install ipykernel
      4) python -m ipykernel install --user --name=.venv
      I am naming it .venv to hide the file but its not necessary. You can replace each .venv with just venv as he does in the video.
      But more important is that step 3 ipykernel is installed after activating the venv and you only need to do this once in each environment you create.
      In Jupyter, your venv option at top right connects with the kernel in your cwd if it exists.

    • @fabien7363
      @fabien7363 3 года назад

      @@loudencm Yes, I just got it to work as well, thanks for your answer though! Indeed, after creating the venv and activating it, it is crucial to pip install ipykernel before proceeding.

  • @theraczcar
    @theraczcar 3 года назад +1

    The text is too small in this video. Please consider zooming in a little bit. Otherwise great stuff

    • @SATSifaction
      @SATSifaction  3 года назад

      Thank you for the feedback. I will in future

  • @LucasOliveira-cs6hz
    @LucasOliveira-cs6hz 3 года назад

    fix in 5:07

  • @huangbinapple
    @huangbinapple 4 года назад

    ipython "kernel" not "kernal"