Python venv simply explained for BOTH Windows and Linux

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

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

  • @jimshapedcoding
    @jimshapedcoding  3 года назад +8

    It will be my mistake saying that venv (in current state) reaches 300MB, as I pointed out to the space that is left on my disk ... (Which is 300GB anyway, my calculation was wrong there)
    Originally, the size on the disk of a venv (empty from additional libraries installed) would be around 20MB. As we keep installing libraries, it will get larger.
    Thanks a lot to​ @Doug Sigman for mentioning this out.
    Will you use virtual environments from now on?

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

    Oh my god, I was going crazy with my code, so happy I found this!! Thank you :)

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

    Pretty well explained! Thank you so much.

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

    Thanks for another great video. I always learn something in your videos.

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

    Yeah it is so important. Now I know about the virtual environment because of you. Thank you sir ❤️

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

      Thanks Gayashan, feel free to share with more people

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

    Great one Jim

  • @Ловимомент-б6п
    @Ловимомент-б6п 3 года назад +1

    Nice video as always! Do you've any plans on recording videos teaching about Network Programming in Python?

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

    I have a quick question im trying to run a program with the virtual environment but i think one library called tabula is trying to seach java in my
    "machine:"C:\Users\padiaz\Desktop\Actualizaciones\venv\Lib\site-packages\jpype\_jvmfinder.py", line 212, in get_jvm_path
    raise JVMNotFoundException("No JVM shared library file ({0}) "
    jpype._jvmfinder.JVMNotFoundException: No JVM shared library file (jvm.dll) found. Try setting up the JAVA_HOME environment variable properly."
    This is the error im getting, how can i get java into the virtual environment?
    Thanks a lot.

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

    Can someone help me i am trying to ignore the venv but it is not ignoring

  • @SA-oj3bo
    @SA-oj3bo 3 года назад

    Good video Jim. How many years you are using Python? I would like to know where the 2 environment variables are stored, could not find them... Thx

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

      Almost 3 years, using it very intensively for learning purposes for my channel and as well as in my job.
      And what env variables you mean ?

    • @SA-oj3bo
      @SA-oj3bo 3 года назад

      @@jimshapedcoding The env variables for FlasK_APP, FLASK_DEBUG for example. I expected they would be stored in a file in the venv but can not find them :-)

  • @NaNNaN-sh4vz
    @NaNNaN-sh4vz 3 года назад

    thank you, very usful

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

    So we shouldn't put the venv directory on github. However, in this directory there is a file requeirments.txt - how then a person who wants to run this program will know what modules he needs to install?

    • @jimshapedcoding
      @jimshapedcoding  3 года назад +2

      Hey, first of all thanks for watching the tutorial.
      Just to clarify - requirements.txt - Should be maintained
      Venv - Should NOT be maintained
      Then the other user only has to do the following things:
      - Use a git clone command
      - go to project dir
      - python -m venv venv
      - venv\Scripts\activate.bat
      - pip install -r requirements.txt
      And there you go, you have a project with a virtual env, with all the dependencies installed :)

    • @dougsigman9497
      @dougsigman9497 3 года назад +2

      @@jimshapedcoding You quoted the wrong number from the directory listing at 12:52 in this video. The larger number on the last line, 294,263,066,624, is the number of bytes free on the drive. The number of bytes the VENV folder contains is the lower number on the line above, 19,251,480.

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

      Thanks Doug, I was totally confused reading the lines properly while recording, pinned this as a comment :)

  • @SA-oj3bo
    @SA-oj3bo 3 года назад

    What is the reason you create the venv yourself in Pycharm? Pycharm automatically creates one for every new project no?

    • @jimshapedcoding
      @jimshapedcoding  3 года назад +2

      It does, this question is asked in this video somehow similar :) That is my opinion about it:
      Creating the venv from the IDE is just another alternative and I agree with you :). I was using the Pycharm's auto venv creation as well. Sometimes I prefer to do it from my terminal just because I find it easier.
      My only concern doing those things from Pycharm would be sudo privileges in Linux OS. That is why the community would not recommend installing packages from Pycharm to your venv for example. So I would prefer doing all the work from the terminal and getting it done.

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

    Now understand importance of venv

  • @duyha2454
    @duyha2454 2 года назад

    thanks