Reputation: 375
When you're installing modules to python usually you use pip install. Does pip install do anything other than put the modules in the right place? Why can't you just copy and paste the modules?
Upvotes: 7
Views: 5766
Reputation: 77337
Python packages typically have a setup.py
that could do anything from copying a module to building c extensions. Its also common to byte-compile .py files assuming that later users wouldn't have rights to do so after install. You can build distributions with setup.py
, so you could for instance, build a binary distribution for a specific operating system and distribute that. But these days, a popular way to install things is to build a python wheel and let pip do the work for you.
Upvotes: 1
Reputation: 33714
Using pip to install modules is first easier(just need to use pip install). And pip also automatically install all the dependencies needed for the module to run.
It's a lot more work to copy and paste especially downloading from pypi since most modules are stored in a .wheel file and has many versions. Pip will install the correct one for your version of python and runs setup.py automatically.
Upvotes: 1
Reputation: 10662
Using pip not only copies the modules in the right place, it also properly installs dependencies. In addition, the right place varies from one system to another, one version of python to another, and pip handles that as well.
Finally, copying and pasting files takes either manual intervention, or a lot more lines of script than a simple pip install.
Upvotes: 7