Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Dependency management in Python? (http://www.velocityreviews.com/forums/t956442-dependency-management-in-python.html)

Adelbert Chang 01-11-2013 10:23 PM

Dependency management in Python?
 
Hi all,

I've been using Python for a while now but one of my concerns is if it is possible to have some sort of dependency management (not sure if right term)for Python?

In the Scala language there is the Simple Build Tool that lets me specify on a project-by-project basis which libraries I want to use (provided they are in a central repository somewhere) and it will download them for me. Better yet, when a new version comes out I need only change the SBT configuration file for that project and it will download it for me.

Is there something like this for Python. I am typically wary of downloadingPython modules I use like NumPy, SciPy, NetworkX, etc because I want to beable to upgrade at any time and doing so seems to be a hassle - in fact, Iam not entirely sure how to "upgrade".

Thank you and regards,
-Adelbert

Rodrick Brown 01-11-2013 10:34 PM

Re: Dependency management in Python?
 
On Fri, Jan 11, 2013 at 5:23 PM, Adelbert Chang <adelbertc@gmail.com> wrote:

> Hi all,
>
> I've been using Python for a while now but one of my concerns is if it is
> possible to have some sort of dependency management (not sure if right
> term) for Python?
>
> In the Scala language there is the Simple Build Tool that lets me specify
> on a project-by-project basis which libraries I want to use (provided they
> are in a central repository somewhere) and it will download them for me.
> Better yet, when a new version comes out I need only change the SBT
> configuration file for that project and it will download it for me.
>
> Is there something like this for Python. I am typically wary of
> downloading Python modules I use like NumPy, SciPy, NetworkX, etc because I
> want to be able to upgrade at any time and doing so seems to be a hassle -
> in fact, I am not entirely sure how to "upgrade".
>
>

Checkout PIP/setuptools and virtualenv



> Thank you and regards,
> -Adelbert
> --
> http://mail.python.org/mailman/listinfo/python-list
>



Ian Foote 01-11-2013 11:04 PM

Re: Dependency management in Python?
 
On 11/01/13 22:34, Rodrick Brown wrote:
> On Fri, Jan 11, 2013 at 5:23 PM, Adelbert Chang <adelbertc@gmail.com
> <mailto:adelbertc@gmail.com>> wrote:
>
> Hi all,
>
> I've been using Python for a while now but one of my concerns is if
> it is possible to have some sort of dependency management (not sure
> if right term) for Python?
>
> In the Scala language there is the Simple Build Tool that lets me
> specify on a project-by-project basis which libraries I want to use
> (provided they are in a central repository somewhere) and it will
> download them for me. Better yet, when a new version comes out I
> need only change the SBT configuration file for that project and it
> will download it for me.
>
> Is there something like this for Python. I am typically wary of
> downloading Python modules I use like NumPy, SciPy, NetworkX, etc
> because I want to be able to upgrade at any time and doing so seems
> to be a hassle - in fact, I am not entirely sure how to "upgrade".
>
>
> Checkout PIP/setuptools and virtualenv
>
> Thank you and regards,
> -Adelbert
> --
> http://mail.python.org/mailman/listinfo/python-list
>


pip and virtualenv is a great combination. I also like to use
virtualenvwrapper for convenience, but it isn't necessary.

Ian F

Adelbert Chang 01-12-2013 02:42 AM

Re: Dependency management in Python?
 
Perfect, PIP and virtualenv look great.

Another question - how do we then get PIP to the latest version? Or is it relatively easy to uninstall/reinstall PIP?

Adelbert Chang 01-12-2013 02:42 AM

Re: Dependency management in Python?
 
Perfect, PIP and virtualenv look great.

Another question - how do we then get PIP to the latest version? Or is it relatively easy to uninstall/reinstall PIP?

rh 01-12-2013 05:33 AM

Re: Dependency management in Python?
 
On Fri, 11 Jan 2013 18:42:18 -0800 (PST)
Adelbert Chang <adelbertc@gmail.com> wrote:

> Perfect, PIP and virtualenv look great.


Install virtualenv first. If you're running python 3.3 virtual env is
standard.

>
> Another question - how do we then get PIP to the latest version? Or
> is it relatively easy to uninstall/reinstall PIP?


You can install pip to the virtualenv and update that pip or
create a new virtualenv and install a new pip.

Lots of possibilities, depends on your workflow.


Dieter Maurer 01-12-2013 07:14 AM

Re: Dependency management in Python?
 
Adelbert Chang <adelbertc@gmail.com> writes:

> In the Scala language there is the Simple Build Tool that lets me specify on a project-by-project basis which libraries I want to use (provided they are in a central repository somewhere) and it will download them for me. Better yet, when a new version comes out I need only change the SBT configuration file for that project and it will download it for me.


You might also have a look at "zc.buildout" (--> on "PyPI").


alex23 01-12-2013 07:38 AM

Re: Dependency management in Python?
 
On 12 Jan, 17:14, Dieter Maurer <die...@handshake.de> wrote:
> Adelbert Chang <adelbe...@gmail.com> writes:
> > In the Scala language there is the Simple Build Tool that lets me specify on a project-by-project basis which libraries I want to use (provided they are in a central repository somewhere) and it will download them for me.Better yet, when a new version comes out I need only change the SBT configuration file for that project and it will download it for me.

>
> You might also have a look at "zc.buildout" (--> on "PyPI").


+1 for zc.buildout

I find virtualenv is great for setting up quick prototyping
environments, while zc.buildout recipes are a much better approach for
group development.

Thomas Bach 01-12-2013 12:43 PM

Re: Dependency management in Python?
 
On Fri, Jan 11, 2013 at 06:42:18PM -0800, Adelbert Chang wrote:
> Another question - how do we then get PIP to the latest version? Or
> is it relatively easy to uninstall/reinstall PIP?


Simply do a

$ pip install -U distribute
$ pip install -U pip

from time to time in your virtual environment.

As a side note: some versions of distribute, pip and virtualenv do
interact rather poorly on Python 3. Upgrading via easy_install:

$ easy_install -U distribute
$ easy_install -U pip

usually solves these issues.

Have fun!

Thomas


All times are GMT. The time now is 10:38 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.