DO NOT FORGET: 'requirements.txt' In Your Python Projects

preview_player
Показать описание

▶ Become job-ready with Python:

▶ Follow me on Instagram:
Рекомендации по теме
Комментарии
Автор

Clear, useful and helpful: 'pip install pipreqs' for a clean, bare-essential module installation for the project, without all the other stuff. Thanks!

uquantum
Автор

dude i really dont know how i came across your videos...but i am glad i did. Your videos are not the standard python videos 'how to write hello world' but they are USEFUL in the real world and explain all the things that there were never explained. People like me were just forced to pick up these habits of making a requirements, txt files....or writing a main function without knowing why. Thank you so much for these niche videos and really useful packages!

azr
Автор

Sir, just want to say thank you that you save my life. I was a beginner on python and I don't know how to update the requirement.txt but your video help a lot.

aredtomato
Автор

Great video. I'm glad I'm not blindly copying and pasting commands anymore.

vietnguyen
Автор

At last someone who really put it in step by step!!! Thanks!

pedroportella
Автор

I've seen a lot of python tutorials over the last few years. But yours are simply the best out there!

BersekViking
Автор

Something I do on import statements for any modules not in the standard library is to add a comment with the pip command line used to install it: e.g.
from Crypto import SHA256 # python -m pip install pycryptodome
from colors import turnip # python -m pip install ansicolors
and so on. Then I can recursively grep for lines matching 'import.*#' to get a list of the modules required (piped through a quick script to remove duplicates)

Chalisque
Автор

Hi, thanks a lot for your video! This is exactly that I tried to find for my projects setup! Awesome! Thanks!

alexandergumenyuk
Автор

Qst: how do you handle different python versions? Do you need to have separate requirements.txt file for each python version that you use ?

ilanbar
Автор

Thanks for the great video. Exactly what I needed. Few questions if I may: Often it is recommended to do sudo apt update/upgrade. Wouldn't it destroy the version management? 2) I just got the following error when running the requirements: "ERROR: No matching distribution found for gitpython>=3.1.30" . I looked at the gitpython web and they have versions with .30/31/32. Strangely, the command returns many versions, yet all of them are below .30 . Where exactly is the install command is looking at for versions?

YigalBZ
Автор

Regarding venv, I understand it comes with python, but I've seen many manually install pyenv separately.. why, what's the difference between
1) pipx
2) venv / virtualenv
3) pyenv (not pyvenv ) with or without the virtualenv plugin (i.e. pyenv-virtualenv)

Can pip freeze and/or pipreqs ANALYZE my python file and determine which imports/versions are used? I'd like to get a requirements txt of ONLY the packages (and their versions) that are actually used in the code!

bennguyen
Автор

I was trying to solve the library management problem with pipreqs but as you see in the video it get different versions of the packages that "pip freeze" gets. Also we notice that with a large project, pipreqs has a weird behaviour and installs libraries that does'nt even are imported, but are part of the environment. 🤔

JezzVega
Автор

Hey, what's your opinion about pipenv and poetry for handling package management?

christianlestercayabyab
Автор

Hi, what do i do if the project i'm trying to setup has conflicting requirements? I've tried pip freeze > requirements.txt and pip install -r requirements.txt --upgrade --upgrade-strategy eager, but there are a couple of conflicts still! 😢

moreamazing
Автор

I might be wrong, but I'm almost certain the reason pip freeze lists module you aren't using is because you actually are using them. For example I know that requests is based on urllib3 as well as cv2 is based on numpy.

alexjando
Автор

good video, however -r does not stand for requirements but recursive.

Wandile
Автор

got an error message

The term 'pipreqs' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ pipreqs --force
+
+ CategoryInfo : ObjectNotFound: (pipreqs:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

personalaccountchannel
Автор

What is the program you are using I see you always using it but I can’t find it anywhere, it’s probably something I already have I just don’t know what it’s name is, I currently just do everything manually with notepad++ and cmd 😂

Автор

I got an error: "You cannot call a method on a null-valued expression" ???

murphygreen
Автор

I almost always watch and like your videos, but I had to skip this one because I can't read dark text on a black background. *Contrast* is what makes that that whole "print thing" work.

rantalbott