How to Create and Use Virtual Environments in Python With Poetry

  Рет қаралды 124,489

ArjanCodes

ArjanCodes

Күн бұрын

It can be tricky when different packages in Python don't play nice. The solution to this problem is to create an isolated, virtual environment. In this video, I’ll show you how to set up a virtual environment with poetry, a package manager for Python that simplifies dependency management and project packaging.
🚀 Next-Level Python Skillshare Class: skl.sh/3ZQkUEN
✍🏻 Take a quiz on this topic: www.learntail.com/quiz/kkmnju
💡 Get my FREE 7-step guide to help you consistently design great software: arjancodes.com/designguide.
💻 ArjanCodes Blog: www.arjancodes.com/blog
🎓 Courses:
The Software Designer Mindset: www.arjancodes.com/mindset
The Software Designer Mindset Team Packages: www.arjancodes.com/sas
The Software Architect Mindset: Pre-register now! www.arjancodes.com/architect
Next Level Python: Become a Python Expert: www.arjancodes.com/next-level...
The 30-Day Design Challenge: www.arjancodes.com/30ddc
🛒 GEAR & RECOMMENDED BOOKS: kit.co/arjancodes.
👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
💬 Discord: discord.arjan.codes
🐦Twitter: / arjancodes
🌍LinkedIn: / arjancodes
🕵Facebook: / arjancodes
📱Instagram: / arjancodes
♪ Tiktok: / arjancodes
👀 Code reviewers:
- Yoriz
- Ryan Laursen
- James Dooley
- Dale Hagglund
🎥 Video edited by Mark Bacskai: / bacskaimark
💻 Code example by Henrique Branco: / henriqueajnb
🔖 Chapters:
0:00 Intro
1:24 Code example
2:00 Virtual environments
3:00 Tools
4:15 Why poetry?
5:20 Creating a virtual environment with poetry
8:33 Activating it
8:55 Installing dependencies
9:38 Deactivating it
10:11 Removing it
10:27 Packaging and publishing using poetry
11:58 Things to watch out for
14:18 Outro
#arjancodes #softwaredesign #python
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!

Пікірлер: 199
@ArjanCodes
@ArjanCodes 9 ай бұрын
💡 Get my FREE 7-step guide to help you consistently design great software: arjancodes.com/designguide.
@Victorinoeng
@Victorinoeng Жыл бұрын
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)
@ImARichard
@ImARichard Жыл бұрын
Poetry is a 10/10 project tool IMO. Im glad I was able to convince my team to move over to it.
@codingcrashkurse6429
@codingcrashkurse6429 Жыл бұрын
same here, never look back at setuptools 😀
@WouterVandenHove1
@WouterVandenHove1 Жыл бұрын
Unfortunatelty they are introducing the horrible idea of range-pinning / upper-pinning their abstract dependencies. This will create a giant dependency-hell of false positives.
@kevon217
@kevon217 Жыл бұрын
It’s been a game changer for me.
@zscoder
@zscoder Жыл бұрын
What was your team using before?
Жыл бұрын
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!
@ArjanCodes
@ArjanCodes Жыл бұрын
Great to hear!
@PaulFWatts
@PaulFWatts Жыл бұрын
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 8 ай бұрын
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.
@kerryw6361
@kerryw6361 11 ай бұрын
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 Жыл бұрын
I've actually been using conda for this, even for non-Python projects, and it worked well for me so far
@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.
@DevelopXp
@DevelopXp Жыл бұрын
Finally sounds like theres a decent python project package manager. Can’t wait to use it
@caetanog_
@caetanog_ Жыл бұрын
At work we started using poetry, it helped us a lot to deploy and also manage de dependencies.
@loic1665
@loic1665 Жыл бұрын
Poetry is life! Seriously it's a great tool, at word we use it all the time and for my personal projets I would use it without an hesitation too!
@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.
@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
@DarknezRocks
@DarknezRocks Жыл бұрын
Thanks Arjan, was waiting a long time for this video. Finally Poetry gets explained in a good and clear way!
@ArjanCodes
@ArjanCodes Жыл бұрын
Thank you, glad you liked it!
@cdgarzon1
@cdgarzon1 Жыл бұрын
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
@sillybuttons925
@sillybuttons925 Жыл бұрын
Try out tox to support multiple
@FollowPathfinder
@FollowPathfinder Жыл бұрын
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.
@ln8416
@ln8416 4 күн бұрын
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 :)
@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!
@milandean
@milandean Жыл бұрын
So glad this video finally came out!!
@ArjanCodes
@ArjanCodes Жыл бұрын
Haha, yes it took me a while :)
@user-wr4yl7tx3w
@user-wr4yl7tx3w Жыл бұрын
This was really well explained.
@hY-ug8vn
@hY-ug8vn Жыл бұрын
you're a champ Arjan
@yash1152
@yash1152 Жыл бұрын
3:04 venv (built-in)
@yash1152
@yash1152 Жыл бұрын
5:13 lock file: yeah conda also uses that. but i dont understand what does that entail practically.
@yash1152
@yash1152 Жыл бұрын
8:20 idky but in default github codespaces (running ubuntu); via python's builtin venv: the .venv dir was actually only 25 MB despite the packages being large 100-200 MB. and also, on rm -r .venv and reinstalling; it didnt download but used from cache. I thought maybe the packages are at a global location there.
@yash1152
@yash1152 5 ай бұрын
coming today back to this quick rununp. the extension for reStructuredText lextudio.restructuredtext on vscodium mentions in #409 that _"While many ... , Pipenv shows a good enough architecture and a clean way to integrate. However, venv is widely used and part of Python standard."_ and looking at pipenv's pypi listing, it seems really good: brings _most_ benefits of conda lineage here: * manageable as a separate app (via pipx) * lock files * separate abstract dependency declarations from the last tested combination * dependency graph * Automatically install required Pythons, if pyenv or asdf is available. * Automatically adds/removes packages to a Pipfile when they are installed/uninstalled i had tried micromamba¹ (from conda lineage) to install c++ based dlib² package (which₂ doesn't distribute binary .whl on pypi). but it₁ was hard to configure properly, and a bit opaque on where are its things going. there's even no official way to uninstall it lol.
@yash1152
@yash1152 5 ай бұрын
benefits of poetry over pipenv seems that it can be used to: 4:53 * specify python version, so no need of pyenv? 5:04 * publish packages, so no need of setuptools? yeah, the build system table here 5:57 * dev dependencies are mentioned separately :) 6:57 * get info about project. it is even shows python implementation used, so, it hints that it's compatible with other implementations 😋? things to note: 13:21 python packages using c-extensions (numpy, etc). yeah see, the dlib thing - but yep, i was already aware that this would be issue in any project manager which is python's native.
@neobrandsainclair3407
@neobrandsainclair3407 Жыл бұрын
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 Жыл бұрын
Yes that's right!
@daineminton9687
@daineminton9687 Жыл бұрын
Love the videos & quality work you put into them. Could you at some point do some examples, such as: wave function collapse, etc ...?
@thebrigandier
@thebrigandier Жыл бұрын
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?
@iliandili
@iliandili 7 ай бұрын
I moved now from 1.7.1 to August 2023 version 1.6.1 and it worked smoothly
@jindy94
@jindy94 Жыл бұрын
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 Жыл бұрын
About the autocomplete: it seems Fig, and you can do some magic AI tricks
@Eisesser01
@Eisesser01 Жыл бұрын
@@mattiapiccinetti4301 Sadly, macOS only right now :(
@alansnyder8448
@alansnyder8448 9 ай бұрын
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.
@johncrunk8038
@johncrunk8038 Жыл бұрын
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... 😱
@jithinsasikumar9576
@jithinsasikumar9576 Жыл бұрын
Thanks a lot for this video. Loved it :)
@ArjanCodes
@ArjanCodes Жыл бұрын
Glad you liked it!
@samoylov1973
@samoylov1973 Жыл бұрын
Thanks for explaining! But docker looks more preferable to me in such cases. Poetry could be, if it were not as complicated for set up.
@MrSith-yp3yq
@MrSith-yp3yq 7 ай бұрын
Another fantastic video! Thank you 🙂
@ArjanCodes
@ArjanCodes 7 ай бұрын
Glad you enjoyed it!
@UNgineering
@UNgineering Жыл бұрын
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 Жыл бұрын
2. I have used Pipenv before and switched to Poetry because it's much faster
@bonquaviusdingle5720
@bonquaviusdingle5720 Жыл бұрын
Poetry locks dependencies faster, and clearly explains when there is a dependency conflict.
@armagaan009
@armagaan009 4 ай бұрын
Thank you for the video. It is better than Poetry's "Introduction" and "Basic Usage" pages. They are confusing.
@ArjanCodes
@ArjanCodes 4 ай бұрын
I'm glad the video was helpful!
@rbalfanz
@rbalfanz Жыл бұрын
I like pip-compile (from pip-tools) for the simplicity and keeping with the de facto requirements.txt file.
@OlliWilkman
@OlliWilkman Жыл бұрын
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 10 ай бұрын
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 10 ай бұрын
@@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 10 ай бұрын
@@OlliWilkman Thanks mate, appreciate your input
@_jdfx
@_jdfx Жыл бұрын
Very cool! it's like Cargo but for Python :)
@awuyadaniel8982
@awuyadaniel8982 6 ай бұрын
Wow.. Made it look so easy Thank you very much
@ArjanCodes
@ArjanCodes 6 ай бұрын
Glad the video was helpful!
@alefrodrigopereira9708
@alefrodrigopereira9708 9 ай бұрын
Very good. Thanks for sharing your knowlage with us.
@ArjanCodes
@ArjanCodes 9 ай бұрын
My pleasure!Thanks for your comment :)
@chineduezeofor2481
@chineduezeofor2481 5 ай бұрын
Thank you for making this awesome video.
@ArjanCodes
@ArjanCodes 5 ай бұрын
Glad you enjoyed the video!
@NickWindham
@NickWindham Жыл бұрын
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.
@SumitSahoo
@SumitSahoo Жыл бұрын
Thanks for introducing me to Poetry :)
@ArjanCodes
@ArjanCodes Жыл бұрын
You are very welcome! :)
@zscoder
@zscoder Жыл бұрын
How were you able to have a terminal as a tab in this video on vscode?
@BillTheGreek7
@BillTheGreek7 Жыл бұрын
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 Жыл бұрын
Thanks for the tips!
@jewpcabra666
@jewpcabra666 Жыл бұрын
i wish you had talked more about the lock file - that is what always messes me up with poetry!
@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"
@kluchtube7042
@kluchtube7042 Жыл бұрын
hey can you tell how do you use intelli sense like code suggestion in your terminal when you type python commands ?
@senzmaki4890
@senzmaki4890 6 ай бұрын
nice vid, what do you use for the terminal intellisense
@user-cd8ze7eo6e
@user-cd8ze7eo6e 6 ай бұрын
perfect thanks
@ArjanCodes
@ArjanCodes 5 ай бұрын
Glad the video was helpful!
@user-lz3wv6sk5k
@user-lz3wv6sk5k Жыл бұрын
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...)
@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)
@DaveParr
@DaveParr Жыл бұрын
@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 10 ай бұрын
It's Fig
@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.
@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
@DavidFodor1
@DavidFodor1 Жыл бұрын
The metaverse joke was fire 😄
@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.
@user-hj4wq7uz4z
@user-hj4wq7uz4z Жыл бұрын
nice content
@abencomo
@abencomo 2 ай бұрын
@ArjanCodes, is that Python tab a plug-in console for VSCode?
@adibmosharrof217
@adibmosharrof217 Жыл бұрын
what terminal do you use? its really handy to have autocomplete feature in terminal
@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.
@RonWaller
@RonWaller 11 ай бұрын
can Poetry config in project setting be a default when setting up future projects?
@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?
@bonquaviusdingle5720
@bonquaviusdingle5720 Жыл бұрын
poetry lock poetry update Much simpler than a lot of other managers
@Mike-dt1yg
@Mike-dt1yg Жыл бұрын
Poetry rocks!
@pythonsamurai
@pythonsamurai Жыл бұрын
7:04 You can do it by simply writing... (watching in the notes to find the command) ...
@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?
@import_this
@import_this Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
@@bartman060890 I will :)
@user-sh1bz4ql6t
@user-sh1bz4ql6t 4 ай бұрын
Thank you for this great intro! Unrelated: how are you getting that autocomplete tooltip in your vscode terminal ?
@_rtdp_
@_rtdp_ 11 ай бұрын
poetry + poethepoem = easy python development ❤
@mounikaav46
@mounikaav46 3 ай бұрын
Great vedio. how can we debug the poetry app from VSCode ?
@michaelxia99
@michaelxia99 11 ай бұрын
Does anyone know what terminal setting he is using to get that green arrow and short clean path?
@Ezio2848
@Ezio2848 Жыл бұрын
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
@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!
@anefuoche1053
@anefuoche1053 Жыл бұрын
I am a beginner. how did you arrive in the environment(IDE OR FOLDER) you are using for installing poetry?
@nbansal
@nbansal Жыл бұрын
Thanks for this video. I just have a small question. What do you think about `pyenv virtualenv` VS `poetry`? More specifically, here is what I would like and would appreciate your help -- 1. I really like `pyenv`. I use it to install different python versions and **also to install virtual environments**. I don't want poetry to replace it. 2. However, I would like to install packages using poetry so that it automatically gets added to `.toml` file generated using `poetry init` command. However, I faced an issue in the second command. When I did `poetry add numpy`, it says `Failed to unlock the collection!`. I am completely new to poetry. Could anyone help me out?
@pythonsamurai
@pythonsamurai Жыл бұрын
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?
@wevertonmarx
@wevertonmarx Жыл бұрын
Can you make a video about Poetry's competitor PDM and compare the two?
@M3MYS3LF1979
@M3MYS3LF1979 Жыл бұрын
Ditto the newest kid on the block, Rye. Same dev as Flask
@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
@AAZinvicto
@AAZinvicto Жыл бұрын
what is the benefit of having the virtual environment folder within the project directory?
@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
@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.
@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.
@user-cz2el2eg8v
@user-cz2el2eg8v 4 ай бұрын
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!
@darkjord5823
@darkjord5823 10 ай бұрын
yooo what terminal is that that gives you suggestions like that?
@yomajo
@yomajo Жыл бұрын
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.
@pope-pylinux-vi
@pope-pylinux-vi Жыл бұрын
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 Жыл бұрын
It has native completion support built in. Run “poetry help completions” and follow the steps.
@converter
@converter 8 ай бұрын
May I ask whats the type hinting in your command line? :)
@mileta99
@mileta99 Жыл бұрын
Hi Arjan, nice video, I've been using venv and pipenv for a long time, and I do like poetry seems like more complete then pipenv. But I'm just curious what is the best practice to use poetry in docker (for PROD environment )? I found a lot of different approaches on stuck-overflow but not sure which is the best. It would be nice if you share your approach and how you use poetry with docker. Thanks in advance :)
@alphenit
@alphenit Жыл бұрын
Does the docker image itself not provide enough isolation?
@mileta99
@mileta99 Жыл бұрын
@@alphenit of course, but for local deveopment its easier to use virtual environment.
@alphenit
@alphenit Жыл бұрын
@@mileta99 Then I must have misunderstood you because you wrote: "But I'm just curious what is the best practice to use poetry in docker"
@mileta99
@mileta99 Жыл бұрын
@@alphenit yes, well poetry doesnt requirements.txt when I run docker I need to generate this file using poetry, I was wondering if there is a better way use poetry with docker :)
@buzzdev
@buzzdev Жыл бұрын
VSCode was never recognizing my poetry env unless i’ve added it manually into settings.
@tpag20
@tpag20 Жыл бұрын
how about the PDM
@M3MYS3LF1979
@M3MYS3LF1979 Жыл бұрын
Can export a requirements.txt file for backward compatibility/docker containers: `poetry export -f requirements.txt --output requirements.txt --without-hashes`
@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.
@rangav8638
@rangav8638 5 ай бұрын
If I have sub modules that have their own packages that need to be installed (thing of plugins). How will we manage installation of these with Poetry?
@RahulSharma-lw2ss
@RahulSharma-lw2ss 7 ай бұрын
Nice
@alirezahaghi2812
@alirezahaghi2812 9 ай бұрын
how your terminal suggests all arguments? I've already installed zsh and oh-my-zsh, but it does not suggest options.
@davea136
@davea136 Жыл бұрын
Arjan is it okay if I link to this video as a reference in a post I am writing about virtual environments (venv, renv, jail-rooted servers, etc.)? Thank you for the excellent channel!
@ArjanCodes
@ArjanCodes Жыл бұрын
Sure Dave! You can link it as a reference :)
@djl3009
@djl3009 Жыл бұрын
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.
@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?
@ReRubis
@ReRubis Жыл бұрын
But what do you think about pdm?
@pingpangqiu5605
@pingpangqiu5605 3 ай бұрын
should poetry be installed in an venv or globally?
How to Build a Complete Python Package Step-by-Step
20:28
ArjanCodes
Рет қаралды 172 М.
7 Python Code Smells: Olfactory Offenses To Avoid At All Costs
22:10
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 24 МЛН
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
Python Poetry in 8 Minutes
8:27
ArjanCodes
Рет қаралды 53 М.
Next-Level Concurrent Programming In Python With Asyncio
19:19
ArjanCodes
Рет қаралды 167 М.
The Complete Guide to Python Virtual Environments!
15:52
teclado
Рет қаралды 332 М.
Protocol Or ABC In Python - When to Use Which One?
23:45
ArjanCodes
Рет қаралды 198 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 371 М.
Python Virtual Environment and pip for Beginners
30:39
Dave Gray
Рет қаралды 23 М.
Here’s a More Pythonic Factory Pattern
23:18
ArjanCodes
Рет қаралды 99 М.
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 24 МЛН