Packages can be considered as a collection of modules. Such a file is called a module definitions from a module can be imported into other modules or in the program that we code.
![how to install modules in python on mac how to install modules in python on mac](https://media.geeksforgeeks.org/wp-content/uploads/20200312114046/verify-install-macos-pip.png)
To support this, Python has a way to put a code definition in a file and use them in another script or directly in an interactive instance of the interpreter. Also, we may want to use a handy function that we have written in several programs without copying its definition into each program. This is known as writing a script.Īs a program gets longer, we may want it to split it into several small files for easier maintenance. Therefore, in order to write a longer program, we might consider switching to a text editor to prepare an input for the interpreter and running it with that file as an input instead. The definitions that we create(functions and variables) will be lost if we quit the console and enter it again.
![how to install modules in python on mac how to install modules in python on mac](https://vbook.pub/img/crop/300x300/qwy1jl04x3wm.jpg)
![how to install modules in python on mac how to install modules in python on mac](https://carldesouza.com/wp-content/uploads/2019/09/img_5d71afce9ef70.png)
#HOW TO INSTALL MODULES IN PYTHON ON MAC HOW TO#
Before we start with the tutorial on how to install Python packages, let us take a step back and understand the role packages play in the Python ecosystem.