
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How do we use easy_install to install Python modules?
Easy Install is a python module that is bundled with setuptools (easy_install) that allows you to download, compile, install, and manage Python packages automatically. It was included in setuptools in 2004 and is now deprecated. It was remarkable at the time for automatically installing dependencies and installing packages from PyPI using requirement specifiers.
Pip was released later in 2008 as a replacement for easy install, albeit it was still primarily based on setuptools components. Installing Python modules should be done with pip rather than easy install. You can use easy_install to install pip if you have it. The following line of code can be used to install pip in your system using easy_install.
easy_install pip
To download a package we simply include the filename/ package name after the easy_install command. It will download the packages along with its dependencies.
easy_install numpy
The following output is obtained after the successful completion of
WARNING: The easy_install command is deprecated and will be removed in a future version. Searching for numpy Best match: numpy 1.18.5 Adding numpy 1.18.5 to easy-install.pth file Installing f2py-script.py script to C:\Users\jsmur\anaconda3\Scripts Installing f2py.exe script to C:\Users\jsmur\anaconda3\Scripts Using c:\users\jsmur\anaconda3\lib\site-packages Processing dependencies for numpy Finished processing dependencies for numpy
Why we use pip over easy_install?
Pip was designed to improve on easy install in the following ways.
Before installation, all packages are downloaded. As a result, a partially completed installation does not occur.
On the console, care is taken to display useful output.
The reasons for actions are recorded. For example, while installing a package, pip keeps track of why that package was required.
Error messages should be informative.
Because the code is relatively short and cohesive, it is easier to use programmatically.
Packages do not have to be installed as egg archives; they can be installed in their entirety (while keeping the egg metadata).
Other version control systems are supported natively (Git, Mercurial and Bazaar)Other version control systems are supported natively (Git, Mercurial and Bazaar)
Package uninstallation
It is simple to define fixed sets of requirements and reproduce a set of packages in a reliable manner.
Now you can use pip to install the module you want. For example, To install the latest version of "SomeProject" we can use the following command.
pip install 'SomeProject'
To install a specific version, the following line of code can be used.
pip install 'SomeProject==1.4'
To install greater than or equal to one version and less than another, the following line of code can be used.
pip install 'SomeProject>=1,<2'
- Related Articles
- How to use pip to install python modules in easy way?
- How to install Python modules in Cygwin?
- How to install python modules without root access?
- How to install libxml2 with python modules on Mac?
- How to install python modules and their dependencies easily?
- How to Install two python modules with same name?
- How to install and import Python modules at runtime?
- How to use remote python modules?
- How do Python modules work?
- How to use pip or easy_install Tkinter on Windows?
- How to use Python modules over Paramiko (SSH)?
- How we can bundle multiple python modules?
- How to use multiple modules with Python import Statement?
- How do we use Python in interactive mode?
- How do we use Python in script mode?
