The Best Way To Install Python Modules On Ubuntu Linux | pip-tools

  Рет қаралды 14,902

Monkhaus

Monkhaus

Күн бұрын

Follow me on Twitter:
in...
Hello friends, in this video I'm going to be showing you my favourite way to install python modules.
I will be showing you how to install compatible versions of django, djangorestframework and pytest.
Django is a python framework for web development and pytest is a framework for testing our python code.
We're going to start by setting up a virtual environment. Then we're going to go ahead and activate the virtual environment.
Our virtual environmment is now activated as you can see here. Anything we install will only be available inside the virtual environment.
Normally people install python packages with pip install like this
This would install a python module called pytest.
However if we wanted to install multiple things that need compatible versions to work this would be difficult.
Instead we can use this amazing package called pip-tools which we're going to use to install all of the packages we need to be compatible.
We can install this with pip like so.
Then we're going to create a requirements.in file. Inside here we're going to list all of the modules we want.
I want to specify that I want django==3.1 like so. But we also want to install compatible versions of djangorestframework and pytest .
We can then exit and save.
We will now use pip-tools, and we'll create a requirements.txt file with the following command:
This creates a new file called requirements.txt which tells us which versions of software for each of these modules to install.
Then all we have to do to download these is the following command.
And just like that we have all of our python modules installed and we already know they will be compatible with each other.
We can now check that django is installed.
And that's it for this video, so hopefully that was useful, you'd now be able to set up your django project and use pytest and use djangorestframework.
Thank you for watching.

Пікірлер: 6
@Monkhaus
@Monkhaus 3 жыл бұрын
What are people working on?
@ak-up8fg
@ak-up8fg 3 жыл бұрын
Thanks,this one is really helpful for me,i hited the sub.
@maurolopezgyt
@maurolopezgyt 2 жыл бұрын
Thank so much! This video is useful a lot.
@sakshamgarg7820
@sakshamgarg7820 3 жыл бұрын
thanks, this helps a lot!
@loulou81400
@loulou81400 3 жыл бұрын
hello, nice tut, have you a video or tutorial on how to install virtual environment like venv on ubuntu?
@ak-up8fg
@ak-up8fg 3 жыл бұрын
Hey monk,How i create django project
진짜✅ 아님 가짜❌???
0:21
승비니 Seungbini
Рет қаралды 10 МЛН
УЛИЧНЫЕ МУЗЫКАНТЫ В СОЧИ 🤘🏻
0:33
РОК ЗАВОД
Рет қаралды 7 МЛН
60 Linux Commands you NEED to know (in 10 minutes)
10:50
NetworkChuck
Рет қаралды 1,8 МЛН
Inspecting Python Modules and Classes With "dir()" And "help()"
13:09
The Complete Guide to Python Virtual Environments!
15:52
teclado
Рет қаралды 384 М.
Python Workshop - Installing Packages
10:34
Core Electronics
Рет қаралды 146 М.
How to install Linux (Ubuntu) & Remove Windows
10:20
NH Soft
Рет қаралды 216 М.
Python on Linux Mint: Setting up Linux Mint for Python
21:30
Red Eyed Coder Club
Рет қаралды 20 М.