-1

I am little confused. Newbie into Python, apologies if I am asking silly ones. What is the need of pip if we can run a file using python filename?

What is the difference between python setup.py install and pip install package_name if both are used for installing packages? Which is good?

Mahesh Mohan
  • 103
  • 3
  • 9

3 Answers3

1

pip is a recommended tool for installing Python packages. For example, if you need to install an external package/library, say requests, you have to install it first using pip.

pip install requests

In your current scenario, you may not have to use external libraries. However, you may need it in future.

Tevin Joseph K O
  • 2,574
  • 22
  • 24
1

From wikipedia:

pip is a recursive acronym that can stand for either "Pip Installs Packages" or "Pip Installs Python"


As you are newbie, you may not even know why you would need a "package manager".

Python is shipped with some basic built-in modules like the math module for extra maths operators and the re module for executing regular expressions. These are pre-included as they are considered quite useful and will be used quite a lot. However, more obscure or larger modules such as numpy (C based arrays) and others are not included - this is where pip comes in.

You can use the "package manager" to install, uninstall, update etc. any package within PyPI which is the Python Package Index. The result of this is that Python remains small, but there are immediately millions of free packages available for use if desired.

Joe Iddon
  • 20,101
  • 7
  • 33
  • 54
  • We can also install custom packages along with the built-in packages right? – Mahesh Mohan Jun 20 '18 at 12:00
  • @MaheshMohan What do you mean by "custom packages"? Most Python packages are available for download with `pip`. When you write your own script, it is not a package, it is a program that may use packages but you run yourself so maybe you are confused in that aspect. You don't need `pip` at all if you just want to write the most basic `print('hello world')` script as no non built-in packages are required. – Joe Iddon Jun 20 '18 at 14:01
1

According to Wikipedia

pip is a package management system used to install and manage software packages written in Python. Many packages can be found in the default source for packages and their dependencies — Python Package Index (PyPI).

Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include pip (pip3 for Python 3) by default.pip is a recursive acronym that can stand for either "Pip Installs Packages" or "Pip Installs Python". Alternatively, pip stands for "preferred installer program".

nonamelowlife
  • 23
  • 1
  • 10