How to Create and Use Virtual Environments in Python With Poetry

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024

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

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

    💡 Get my FREE 7-step guide to help you consistently design great software: arjancodes.com/designguide.

  • @Victorinoeng
    @Victorinoeng ปีที่แล้ว +52

    There are some additional super useful functionally worth mentioning:
    1) In the toml file, there are special characters that define/limit how to update dependencies versions (^, ~);
    2) the lock file “locks” the exact versions for dependencies and transient ones. This ensures reproducibility and is a game changes for production ready code. it is possible to test updating packages and only committing the new .lock file if everything works.
    3) poetry has a cli tool to auto bump the package version (major, minor, patch) which makes it even easier when managing a package
    4) for some compatibility cases, it is also possible to export the dependencies into a requirements.txt file (for example, when using serverless framework to deploy an AWS Lambda function using the pip-requirements plugin)

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

      How and when would you use 3? Can you give an example?

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

      Sure thing! When building an automated CI pipeline that bumps the package version and then deploys it (build/publish). This can even be automated based on the commit message standard, such as *semantic versioning*. There is a cool package, commitzen, that really helps!

  • @PaulFWatts
    @PaulFWatts ปีที่แล้ว +31

    I don't think it can be underestimated what a "rabbit hole of pain 🙂" this topic can be for the python programmer who is moving beyond the basics (I know from personal experience lol). Especially compared to `cargo` in Rust. Poetry has simplified my Python development, and this is an excellent video in getting started with it. Thanks for all your great videos!

    • @dr.mikeybee
      @dr.mikeybee 10 หลายเดือนก่อน

      I find that the most critical part of installing packages for some repo or another is getting the python version right. Very often if pip install -r fails, it's because you need an older version of python. So delete your virtual environment and recreate it with an older version. I usually use conda, so it's conda create -n python=3.7 or so.

  •  ปีที่แล้ว +16

    This has to be one of the best and most concise tutorials I've watched lately. I've been using virtualenvs and venvs with pipfiles for years, but this looks like the next logical step. Thanks!

  • @kerryw6361
    @kerryw6361 ปีที่แล้ว +5

    This is a great video to understand the use of poetry. After this video, I find the official Poetry documentation making a lot of sense. Thank you!!

  • @archibald-yc5le
    @archibald-yc5le ปีที่แล้ว +3

    I've actually been using conda for this, even for non-Python projects, and it worked well for me so far

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

    Finally sounds like theres a decent python project package manager. Can’t wait to use it

  • @DarknezRocks
    @DarknezRocks ปีที่แล้ว +7

    Thanks Arjan, was waiting a long time for this video. Finally Poetry gets explained in a good and clear way!

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

      Thank you, glad you liked it!

  • @jindy94
    @jindy94 ปีที่แล้ว +17

    Another great video!! Just a few questions:
    1. Could you share your shell setup? The autocomplete is amazing!!
    2. There doesn't seem to have a seamless way to build the dependencies into a docker and make it as lightweight as compared to building the dependencies through requirements.txt.. How would you suggest going around this problem?

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

      You can use poetry export to generate a requirements.txt based on the dependencies in your poetry.lock file

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

      About the autocomplete: it seems Fig, and you can do some magic AI tricks

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

      @@mattiapiccinetti4301 Sadly, macOS only right now :(

  • @ln8416
    @ln8416 2 หลายเดือนก่อน

    Thanks, before watching the video I struggled at quite some points. Now it is very clear to me and I see the advantages of using Poetry :)

  • @thebrigandier
    @thebrigandier ปีที่แล้ว +7

    That .venv tip can be handy for people using VSCode's dev containers feature. If you need to rebuild the dev container you end up trashing its filesystem usually, along with any Poetry virtualenvs that may have been created in the container filesystem. By using .venv within your repo's source directory (probably want to .gitignore it), you can rebuild the dev container without wiping your venv, saving you from doing poetry install repeatedly.

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

      You mean mounting the .venv directory into the container?

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

    Good video! I've been using poetry for some time now, and recently ran into the case where you have a poetry project that uses a python version that needs to be updated, which means you have to manage multiple python version in your system and need to tell poetry to go from one version to another. That would be a really good topic for another video as I see a lot of confusing information online about pyenv and poetry working together

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

    I'm using pyenv to manage python versions, and then having poetry creating creating a virtual env inside the project. Really glad with this setup.

  • @iliandili
    @iliandili 10 หลายเดือนก่อน

    I moved now from 1.7.1 to August 2023 version 1.6.1 and it worked smoothly

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

    Thanks for the video. If I recall correctly, Poetry also allows to have multiple sets of dependencies, for example a dev set where you put all your tests dependancies (like pytest), and a prod set for the app dependencies.

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

      Yes that's right!

  • @UNgineering
    @UNgineering ปีที่แล้ว +5

    2 questions:
    1. which config/plugin/script are you using to provide those neat autocompletions when typing terminal commands?
    2. what is the advantage of poetry over pipenv? they look very similar in functionality (aside from publishing to pypi), and pipenv creates Pipfile, which looks almost identical to pryproject.toml (same with their lockfiles).

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

      2. I have used Pipenv before and switched to Poetry because it's much faster

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

      Poetry locks dependencies faster, and clearly explains when there is a dependency conflict.

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

    I have been using pipenv for a couple years. I really like poetry so maybe it's time to learn a new tool. It's actually not that different than pipenv, but cool. Thanks.

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

      Yeah I'm fond of pipenv too but it's so slow... 😱

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

    Personally, I've not had much luck with poetry. It isn't deterministic. Sometimes it breaks in bad ways, and this has happened enough in a team environment that I've given up on it completely.
    I'm looking for something other than poetry. Currently just using virtual environments, but I am waiting for the right solution to come along.

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

    At work we started using poetry, it helped us a lot to deploy and also manage de dependencies.

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

    Thank for the video Arjan, I think some medieval emperors would be interested in the practical applications of a language like Python, such as its ability to automate tasks and process large amounts of data. They would appreciate its ability to create visualizations and simulations, which could be useful for military planning or other strategic purposes.

  • @chineduezeofor2481
    @chineduezeofor2481 8 หลายเดือนก่อน +1

    Thank you for making this awesome video.

    • @ArjanCodes
      @ArjanCodes  8 หลายเดือนก่อน

      Glad you enjoyed the video!

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

    I love poetry + pyenv. It allows me to define the dependencies exactly so that anybody that clones my repo can get the exact experience I get.

  • @armagaan009
    @armagaan009 7 หลายเดือนก่อน

    Thank you for the video. It is better than Poetry's "Introduction" and "Basic Usage" pages. They are confusing.

    • @ArjanCodes
      @ArjanCodes  7 หลายเดือนก่อน

      I'm glad the video was helpful!

  • @EvanYoung-xo8kd
    @EvanYoung-xo8kd ปีที่แล้ว

    Thanks for this!! I started playing with Poetry a little while ago and needed this video!

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

      You're so welcome!

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

    I use Pycharm. A main reason is how it creates a new environment for me for each new project. VS Code needs an easier built in feature like Pycharm.

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

      pycharm was my favorite until vscode's pylance started giving better code hints and i got attached to some vscode extensions. But there are many features I miss... the doc-string rendering on hover was much neater in pycharm.

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

    Hello!
    I love your videos!
    Only one thing I would like to point out (in case it happens and you see this comment) is to use a bigger screen? or zoom out a bit?, because it looks really crowded now (watching on PC though)
    Thank you for your content!!

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

      Thanks for the tips!

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

    Thank you son much exactly when I tart learning poetry😊 excellent tips to delete old env and reinstall them evently to limite size of project

  • @hY-ug8vn
    @hY-ug8vn ปีที่แล้ว +1

    you're a champ Arjan

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

    How were you able to have a terminal as a tab in this video on vscode?

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

    7:04 You can do it by simply writing... (watching in the notes to find the command) ...

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

    So glad this video finally came out!!

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

      Haha, yes it took me a while :)

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

    I used Poetry for a while but switched to PDM lately. It's pretty much the same experience but follows the Python PEP standards a little better (though has to sacrifice the nice version number operators), and I hear the dependency resolver is faster in many cases though that hasn't been an issue for me.

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

      Hey mate, how's your experience with PDM since then compared to Poetry? I am trying to learn either of the two and saw your comments, hope you could shed some light. I found poetry is more popular (for now) and hence would get more community support. If there is no noticeable difference, I might just pick poetry.

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

      @@alsonyang230 I still use PDM and I wouldn't go back to Poetry. I'm also just today considering converting an older Poetry project into PDM. But I don't have any very strong recommendation either way. And I'd say that if you learn one, you'll get the hang of the other one fairly quickly if necessary.

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

      @@OlliWilkman Thanks mate, appreciate your input

  • @alaindettorre5807
    @alaindettorre5807 9 วันที่ผ่านมา

    Thank you Arjan, that was helpful.
    Coming from the Node world, I thought Python had something more stable resembling the typical package.json file in Node projects, which seems to be this pyproject.toml file. Although Poetry seems nice, it's still a non-standard solution to a common problem. Meh

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

    how about the PDM

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

    I like pip-compile (from pip-tools) for the simplicity and keeping with the de facto requirements.txt file.

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

    poetry lock
    poetry update
    Much simpler than a lot of other managers

  • @dvdsdr-e6t
    @dvdsdr-e6t ปีที่แล้ว

    The metaverse joke was fire 😄

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

    i wish you had talked more about the lock file - that is what always messes me up with poetry!

  • @MikeCorvin-x4p
    @MikeCorvin-x4p ปีที่แล้ว +2

    As always, thanks Arjan for your excellent content! I've not tried Poetry yet but I can't yet see a compelling reason to do so vs using conda/mamba (I usually use the latter). It does look pretty easy to use, but not any easier than conda, just different. What am I missing about Poetry? It does have its enthusiasts here in the comments. How is it's spec easier than a conda env spec?
    Having .venv in the project folder seems ok, but I assume you gitignore it and recreate it as needed so it doesn't clutter things up?
    What I've done using cookiecutter is to setup a project template with simple make machinery that does conda package generation running 'out of the box' so it's easy to deploy the project as a conda package to a local channel (or other). It creates a project conda env with the project with a basic set of packages for dev, incl. sphinx and pytest. It also does sphinx docs and comes with an initial set of strawman doc files. The make also maintains a conda env spec yaml file so I don't bother with requirements.txt and other devs can recreate the env on their platforms when we share the project through a local GitLab (or just a local bare repo). If I need to deploy a wheel or source package the template has all the bits to do that as well (our use cases do not involve deploying to PyPi or other public repos).
    A consideration for us is that we use conda to set envs in which analysts do interactive Python work for operations. In future we might need shell scripts that specify which env to use when invoking particular versions of tools. Some analysts don't even use conda directly, it's invoked in setup scripts to set the correct env or their path is just set to the correct, shared env location when they log in. I guess this is more of the data-sciencey use case that conda is intended for!
    The most painful thing about Python packaging is the ever evolving 'how to do' Python packaging question. What I have in that cookiecutter is a bit of a frankenstein between the setup.py, setup.cfg, the new kid on the block pyproject.toml, and the conda-recipe meta.yml. (I need to watch your recent vid about the PyPi way...)

  • @awuyadaniel8982
    @awuyadaniel8982 8 หลายเดือนก่อน

    Wow.. Made it look so easy
    Thank you very much

    • @ArjanCodes
      @ArjanCodes  8 หลายเดือนก่อน

      Glad the video was helpful!

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

    Thanks for introducing me to Poetry :)

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

      You are very welcome! :)

  • @ErikS-
    @ErikS- ปีที่แล้ว

    Great video!
    I think some viewers may be confused with the "shell". The difference between "normal commands" and "shell commands" isn't that clear in the video.

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

      Thanks for the feedback!

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

    With respect to the DevOps pipeline, when building the Docker image what are the best practise. Do we install poetry etc. If you have already written about this please do share the links

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

    Love the videos & quality work you put into them. Could you at some point do some examples, such as: wave function collapse, etc ...?

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

    I saw almost 0 real pros to use some wrapper over pip. What poetry is actually do beside just adding reqs to file for you which pip won't be able to do?

  • @MrSith-yp3yq
    @MrSith-yp3yq 10 หลายเดือนก่อน

    Another fantastic video! Thank you 🙂

    • @ArjanCodes
      @ArjanCodes  10 หลายเดือนก่อน

      Glad you enjoyed it!

  • @windowsrefund
    @windowsrefund 10 หลายเดือนก่อน

    Excellent presentation. That said, please stop referring to directories as "folders".

  • @wevertonmarx
    @wevertonmarx ปีที่แล้ว +4

    Can you make a video about Poetry's competitor PDM and compare the two?

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

      Ditto the newest kid on the block, Rye. Same dev as Flask

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

    Very cool! it's like Cargo but for Python :)

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

    Sticking to pipenv, thank you. Still ("Activated") post exit, change in conventional keywords (add vs install, remove vs uninstall). If you don't publish packages, I don't see poetry benefits over pipenv. For docker, pipenv has support for requirements.txt (the old dusty way) and poetry does not support it. Having setup pipenv in docker image, gotta say, it's ugly, so I would imagine poetry is no different in that front.

  • @MatiasZulberti
    @MatiasZulberti 7 หลายเดือนก่อน

    Hello @ArjanCodes, great jvideo about poetry! Thanks! I see that you are using a Python's shell??? What kind of magic is that? Is it an extension of VScode? Thanks man! Have a great day!

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

    How do you manage multiple python interpreters with poetry? how do you install them and make sure, they don"t interact with the system installed interpreter?

  • @Mike-dt1yg
    @Mike-dt1yg ปีที่แล้ว +1

    Poetry rocks!

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

    I am a beginner. how did you arrive in the environment(IDE OR FOLDER) you are using for installing poetry?

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

    poetry + poethepoem = easy python development ❤

  • @abencomo
    @abencomo 5 หลายเดือนก่อน

    @ArjanCodes, is that Python tab a plug-in console for VSCode?

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

    Can export a requirements.txt file for backward compatibility/docker containers:
    `poetry export -f requirements.txt --output requirements.txt --without-hashes`

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

    Thanks a lot for this video. Loved it :)

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

      Glad you liked it!

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

    May I ask whats the type hinting in your command line? :)

  • @iliandili
    @iliandili 10 หลายเดือนก่อน

    I try Poetry and I had problem to add few simple packages. Like resolving dependencies last for 500 seconds and then I stopped. After that I try to remove some dependencies (for example Django) and again loooong process currently on 203 seconds :) It looks that I'm going back to pip & venv & requriments.txt :)

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

    I adopted 'hatch' for package builds because it claims to more closely follow modern PEP standards, but after this video, and reading the comments that mention PDM, I am very confused about the best tool to use :S

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

    Hi great tutorial, although can anyone tell me how is the auto complete working in his shell, it looks quite amazing and useful.

  • @flyhawksfly
    @flyhawksfly 7 หลายเดือนก่อน

    Thank you for this great intro! Unrelated: how are you getting that autocomplete tooltip in your vscode terminal ?

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

    12:16 You mention if you're using "pipenv" packages won't automatically be added to a requirements.txt file. I'm guessing you meant to say "pip", since with pipenv dependencies are added to the Pipfile and Pipfile.lock.

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

    @arjancodes great video as always. I'm curious about how you have your terminal set up to get context aware autocomplete suggestions? E.g. the drop down like prompts that describe the rest of the commands and flags?

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

      It's Fig

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

    how your terminal suggests all arguments? I've already installed zsh and oh-my-zsh, but it does not suggest options.

  • @itsaname-t5c
    @itsaname-t5c 8 หลายเดือนก่อน

    perfect thanks

    • @ArjanCodes
      @ArjanCodes  8 หลายเดือนก่อน

      Glad the video was helpful!

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

    Does anyone know what terminal setting he is using to get that green arrow and short clean path?

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w ปีที่แล้ว

    why do you prefer to have the environment inside your project?
    but if you want to share the same virtualenv across multiple projects, then is it better to keep it at default?
    Given that creating a virtualenv inside of each project ends up taking up more disk space, would it be possible to have multiple projects share the same environment? If so, where do you recommend to put the environment in that case?

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

    what is the benefit of having the virtual environment folder within the project directory?

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

    I ran into an issue the moment I installed poetry. I'm pretty new to Python so I don't know what the issue is but no matter if I try in bash, powershell etc all poetry commands are not found. I tried adding it to the $PATH and nothing works. Any help would be appreciated but nothing has worked for me.
    I tried it again on another computer (both use the Microsoft Python) and it worked perfectly but just doesn't work on this other laptop.

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

    For a quite big project we are going to build about 50-100 packages, some larger or more complicated then others. Would it be a good practice to create a project and a venv. for each package we build? And is there a good way to host them privately, and have a way to use these packages to build our applications

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

    i use Pycharm as IDE, ¿need to change to VSCODE? Please @ArjanCodes, do a video of IDEs.

  • @dr.mikeybee
    @dr.mikeybee 10 หลายเดือนก่อน

    A lot of new repos don't have a requirements.txt file. Instead there's a .toml file. So we need to use poetry instead.

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

    How do you deploy an application built with poetry, e.g. what do I have to do if I want to containerise it?

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

    Great Video, just wanted to know if poetry is capable of managing multiple dependency files like we de have different requirements.txt from dev,stag and prod. If that is supported would love to switch to it.

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

    Thanks. Poetry seems really useful but I was put off looking at it more closely a few months ago, after seeing a video on the anthonywritescode youtube channel, where he explained the reasons why he would never use Poetry. Besides citing technical reasons, his decision not to use Poetry also included a "broken trust" issue regarding the actions of package owners.

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

    can Poetry config in project setting be a default when setting up future projects?

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

    What are the differences between poetry and pipenv? I don't see many based on this video, maybe just publishing packages on pypi.

  • @senzmaki
    @senzmaki 8 หลายเดือนก่อน

    nice vid, what do you use for the terminal intellisense

  • @AISWARYAR-et6rp
    @AISWARYAR-et6rp 3 วันที่ผ่านมา

    How should get that toml file

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

    hey can you tell how do you use intelli sense like code suggestion in your terminal when you type python commands ?

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

    what terminal do you use? its really handy to have autocomplete feature in terminal

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

    Hello, love your videos!
    Maybe there is something I'm missing, but if I'm already working well with conda, is there any reason I should switch over to Poetry?

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

      there is no reason to switch even from pip actually

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

    Thank you for this video. Do you know how to install / compile prophet using any of the virtual env tools? (for python 3.11.2)

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

    Seems to be inspired by Rust's cargo.toml and lock file

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

    What are you using on the shell to get those completions? That look really nice

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

      If you go to the poetry page, there's actually an installation option to get Shell completion for whatever shell you use

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

    pip install poetry
    Fatal error in launcher: Unable to create process using '"c:\program files\python38\python.exe" "C:\Program Files\Python38\Scripts\pip
    .exe" install poetry': ?? ??????? ????? ????????? ????.

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

    VSCode was never recognizing my poetry env unless i’ve added it manually into settings.

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

    I started with Python a year ago and came across pipenv and use it since then. Is there an option like the --dev in poetry to install packages only in dev environment? For example, I install mypy and pytest only in dev but not when I run it in prod.

  • @MegaArti2000
    @MegaArti2000 8 หลายเดือนก่อน

    It doesn't resolve the problem of knowing the exact PIP name for a package, though, so what's the big advantage against PIP, since packages have to be manually written and verified in REQUIREMENTS.txt anyway?
    I mean, cv2 is not installed by "pip install cv2", for example, it is "pip install opencv-python".

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

    Im having issues now , it says its not compatible with my python version: s

  • @ThiagoJoséMoserPoletto
    @ThiagoJoséMoserPoletto ปีที่แล้ว

    nice content

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

    Hello Arjan!
    Thanks for your video!
    I would like to know what is the difference between "pip install poetry" and installing with curl (from official docs)? See the difference when working with pyenv?

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

      Follow the official documentation for installation. Rationale: it is better isolated from your python installation. There are scenarios where poetry will uninstall itself if it was installed through pip, because it sees poetry installed even though it is not a dependency of your package.
      Poetry in general removes packages that are not a dependency of your package. I combine poetry with pipx. With pipx I install dev tools like black, mypy, pylint, pycln, etc. In that way they are out of sight for poetry, but I can still use them.

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

      @@bartman060890 Thanks for such a detailed answer! It makes sense.
      What is the advantage of combining pipx and poetry instead of using --group dev?

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

      @@import_this that would work too! I prefer this approach as it extends nicely to all my python work, also if I don't use poetry. But by all means experiment and see what works best for you :)

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

      @@bartman060890 I will :)

  • @pope-pylinux-vi
    @pope-pylinux-vi ปีที่แล้ว +2

    Thanks for the video! For me poetry was a love at first sight ❤ and I use it in every personal project ever since (and often at my work too 😉) A question: what autocompletion for poetry commands do you use here?

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

      It has native completion support built in. Run “poetry help completions” and follow the steps.

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

    Just curious. Do poetry and dependabot work well together? I've read conflicting reports. I tried it on a test repo, and it seemed like dependabot recommended radical version changes in both pyproject.toml and poetry.lock, where poetry said "No dependencies to install or update"

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

    But what do you think about pdm?

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

    THIS VIDEO MAKE MY LIFE EASIER. THANK YOU AEJAN.
    Please can you make a video on the below problem ?
    poetry project that uses a python version that needs to be updated, which means you have to manage multiple python version in your system and need to tell poetry to go from one version to another.

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

    Great video, but I don't understand why people don't use docker to virtualise the envs. If you are a dev, you probably already have docker installed on your machine. May be, don't reinvent the wheel lol. :) :D

  • @igorbeaver4692
    @igorbeaver4692 2 หลายเดือนก่อน

    Got error:
    Warning: The current project could not be installed: No file/folder found for package ppo-and-friends