Dependency management in Python?

A

Adelbert Chang

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
 
R

Rodrick Brown

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
 
I

Ian Foote

On Fri, Jan 11, 2013 at 5:23 PM, Adelbert Chang <[email protected]

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

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

Ian F
 
A

Adelbert Chang

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?
 
A

Adelbert Chang

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?
 
R

rh

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.
 
D

Dieter Maurer

Adelbert Chang said:
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").
 
A

alex23

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.
 
T

Thomas Bach

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top