Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using easy_install inside a python script?

easy_install python extension allows to install python eggs from console like:

easy_install py2app

But is it possible to access easy_install functionality inside a python script? I means, without calling os.system( "easy_install py2app" ) but instead importing easy_install as a python module and using it's native methods?

like image 455
grigoryvp Avatar asked Jun 01 '09 14:06

grigoryvp


People also ask

Is easy_install deprecated?

easy_install, now deprecated, was released in 2004 as part of setuptools. It was notable at the time for installing packages from PyPI using requirement specifiers, and automatically installing dependencies.

What does easy_install do?

Distributes Python programs and libraries (based on the Python Eggs wrapper) It's a python module (easy_install) that is bundled with setuptools. It lets you automatically download, build, install, and manage Python packages.

How do I run python setup py?

To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.

What is easy_install in Linux?

Easy Install is a python module (``easy_install``) bundled with ``setuptools`` that lets you automatically download, build, install, and manage Python packages.


2 Answers

When I look at the setup tools source, it looks like you can try the following.

from setuptools.command import easy_install
easy_install.main( ["-U","py2app"] )
like image 138
S.Lott Avatar answered Nov 07 '22 20:11

S.Lott


from setuptools.command import easy_install

def install_with_easyinstall(package):
    easy_install.main(["-U", package]).

install_with_easyinstall('py2app')
like image 22
nosklo Avatar answered Nov 07 '22 20:11

nosklo