Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python package install using pip or easy_install from repos

The simplest way to deal with python package installations, so far, to me, has been to check out the source from the source control system and then add a symbolic link in the python dist-packages folder.

Clearly since source control provides the complete control to downgrade, upgrade to any branch, tag, it works very well.

Is there a way using one of the Package installers (easy_install or pip or other), one can achieve the same.

easy_install obtains the tar.gz and install them using the setup.py install which installs in the dist-packages folder in python2.6. Is there a way to configure it, or pip to use the source version control system (SVN/GIT/Hg/Bzr) instead.

like image 958
lprsd Avatar asked Jun 23 '09 17:06

lprsd


People also ask

Can you install Python packages using pip?

Most Python packages are now designed to be compatible with pip. If you have a package that's not compatible, then you'll need to do a manual installation. How to manually install a Python package: Download the package and extract it into a local directory.

What is the difference between pip install and Python pip install?

They do exactly the same thing. In fact, the docs for distributing Python modules were just updated to suggest using python -m pip instead of the pip executable, because it's easier to tell which version of python is going to be used to actually run pip that way.

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.


1 Answers

Using pip this is quite easy. For instance:

pip install -e hg+http://bitbucket.org/andrewgodwin/south/#egg=South

Pip will automatically clone the source repo and run "setup.py develop" for you to install it into your environment (which hopefully is a virtualenv). Git, Subversion, Bazaar and Mercurial are all supported.

You can also then run "pip freeze" and it will output a list of your currently-installed packages with their exact versions (including, for develop-installs, the exact revision from the VCS). You can put this straight into a requirements file and later run

pip install -r requirements.txt

to install that same set of packages at the exact same versions.

like image 176
Carl Meyer Avatar answered Sep 19 '22 06:09

Carl Meyer