Easy Install is a
Python module (easy_install) bundled with
setuptools that allows you to automatically download, build, and
install Python packages/modules. When you use it, it is normally downloading
files from
the Internet for installation. On an OS X system, it is found in
/usr/bin. The file there is a Python script
easy_install. You can obtain information on its
usage by typing easy_install --help in a
Terminal window. You can obtain version information using
the command easy_install --version.
$ which easy_install
/usr/bin/easy_install
$ easy_install --help
Global options:
--verbose (-v) run verbosely (default)
--quiet (-q) run quietly (turns verbosity off)
--dry-run (-n) don't actually do anything
--help (-h) show detailed help message
--no-user-cfg ignore pydistutils.cfg in your home directory
Options for 'easy_install' command:
--prefix installation prefix
--zip-ok (-z) install package as a zipfile
--multi-version (-m) make apps have to require() a version
--upgrade (-U) force upgrade (searches PyPI for latest versions)
--install-dir (-d) install package to DIR
--script-dir (-s) install scripts to DIR
--exclude-scripts (-x) Don't install scripts
--always-copy (-a) Copy all needed packages to install dir
--index-url (-i) base URL of Python Package Index
--find-links (-f) additional URL(s) to search for packages
--build-directory (-b) download/extract/build in DIR; keep the results
--optimize (-O) also compile with optimization: -O1 for "python -
O", -O2 for "python -OO", and -O0 to disable
[default: -O0]
--record filename in which to record list of installed
files
--always-unzip (-Z) don't install as a zipfile, no matter what
--site-dirs (-S) list of directories where .pth files work
--editable (-e) Install specified packages in editable form
--no-deps (-N) don't install dependencies
--allow-hosts (-H) pattern(s) that hostnames must match
--local-snapshots-ok (-l) allow building eggs from local checkouts
--version print version information and exit
--no-find-links Don't load find-links defined in packages being
installed
--user install in user site-package
'/Users/jmcamer1/Library/Python/2.7/lib/python/si
te-packages'
usage: easy_install [options] requirement_or_url ...
or: easy_install --help
$ easy_install --version
setuptools 1.1.6
$If you installed LibreOffice on the system, you will likely have other copies of the script on the system.
$ find / -name easy_install.py 2>/dev/null /Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/Ve rsions/3.5/lib/python3.5/site-packages/easy_install.py /Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/Ve rsions/3.5/lib/python3.5/site-packages/setuptools/command/easy_install.py $
To install Python packages on an OS X system using easy_install
you can issue the command sudo easy_install olefile in a
Terminal window
$ sudo easy_install olefile Enter PIN for 'JOHN DOE': Searching for olefile Reading https://pypi.python.org/simple/olefile/ Best match: olefile 0.45.1 Downloading https://pypi.python.org/packages/d3/8a/e0f0e56d6a542dd987f9290ef7b5164636ee597ce8c2932c19c78292d5ec/olefile-0.45.1.zip#md5=f70c0688320548ae0f1b4785e7aefcb9 Processing olefile-0.45.1.zip Writing /tmp/easy_install-Ahie_l/olefile-0.45.1/setup.cfg Running olefile-0.45.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Ahie_l/olefile-0.45.1/egg-dist-tmp-ttoP2p /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) no previously-included directories found matching 'doc/_build' zip_safe flag not set; analyzing archive contents... Adding olefile 0.45.1 to easy-install.pth file Installed /Library/Python/2.7/site-packages/olefile-0.45.1-py2.7.egg Processing dependencies for olefile Finished processing dependencies for olefile $
If you try to install the olefile without root privileges, you will see the following output:
$ easy_install olefile
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-18295.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://pythonhosted.org/setuptools/easy_install.html
Please make the appropriate changes for your system and try again.
$Python code can be packaged in EGG files with a filename extension of .egg. The .egg files can contain code, resources, and metadata - see Internal Structure of Python Eggs.
The
.eggformat is well-suited to distribution and the easy uninstallation or upgrades of code, since the project is essentially self-contained within a single directory or file, unmingled with any other projects' code or resources. It also makes it possible to have multiple versions of a project simultaneously installed, such that individual programs can select the versions they wish to use.
If you have a .egg file, you can install it as a package with
the easy_install script. If you are using a Python 2.x version, you can find
the .egg files for packages installed with easy_install in the
/Library/Python/2.x/site-packages/ where the "x" in "2.x" is
the version of Python in use on the system. You can determine the version
of Python on the system with python --version. E.g.:
$ python --version Python 2.7.10 $ ls /Library/Python/2.7/site-packages/ PyPDF2-1.26.0-py2.7.egg easy-install.pth README olefile-0.45.1-py2.7.egg $
Related articles:
References: