Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is installing Python modules or packages?

A Python module is just a .py source file. A Python package is simply a collection of modules.

So why do we need programs such as pip to 'install' Python modules? Why not just download the files, put them in our project's folder and import them?

What exactly does it mean to 'install' a module or a package? And what exactly does pip do?

Are things different on Windows and on Linux?

like image 982
Aviv Cohn Avatar asked Apr 10 '26 06:04

Aviv Cohn


1 Answers

So why do we need programs such as pip to 'install' Python modules? Why not just download the files, put them in our project's folder and import them?

It's just meant to facilitate the installation of softwares without having to bundle all the dependencies nor ask the user to download the files.

You can type pip install mysoftware and that will also install the required dependencies. You can also upgrade a software easily.

What exactly does it mean to 'install' a module or a package? And what exactly does pip do?

It will copy the files in a directory that is in your Python path. This way you will be able to import the package without having to copy the directory in your project.

like image 170
Maxime Chéramy Avatar answered Apr 11 '26 20:04

Maxime Chéramy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!