RDCEP / EDE

MIT License
2 stars 1 forks source link

using anaconda #11

Closed ghost closed 8 years ago

ghost commented 8 years ago

@njmattes @ricardobarroslourenco i want to use Anaconda instead of pip + virtualenv because it also takes care of C(++) deps, in particular for HDF4,5. the Anaconda repo has the latest (or sometimes almost latest) netcdf4, gdal, psycopg2, flask, sqlalchemy (though not flask-sqlalchemy), and others

however, packages that are not in the conda repo (https://repo.continuum.io/pkgs/) can still be installed through pip and as it turns out Anaconda can now also keep track of packages installed through pip which is really great. so we can install all packages through Anaconda and it also takes care of the C(++) deps.

reinstalling the dependencies on another platform is a 1-liner:

conda env create -f path/to/environment.yml (see: http://stackoverflow.com/questions/18640305/how-to-keep-track-of-pip-installed-packages-in-an-anaconda-conda-env)

i.e. we just need an environment.yml file which contains the Anaconda + pip dependencies.

for some extra info on Anaconda, see: http://conda.pydata.org/docs/_downloads/conda-pip-virtualenv-translator.html. basically, Anaconda = pip + virtualenv in one and conda is essentially the pip part of Anaconda.

let me know if you're fine with this or if you had negative experiences with Anaconda.

njmattes commented 8 years ago

Personally, I can't stand using Anaconda, but that shouldn't stop you from using it. I don't think we should be specifying the development environment on such a low level anyway. I think it should be possible for someone to develop and deploy this project on e.g. a Windows box with every dependency compiled by hand if they want to. Of course that supposes that we have some clear documentation of our dependencies.

ricardobarroslourenco commented 8 years ago

Well, I use both Anaconda, and Pip as well. It is complicated because it's package manager that is not brought by the community. There is a interesting trend at stackoverflow.

ghost commented 8 years ago

you can indeed combine conda and pip i.e. conda is now pip - aware (since not so long ago), see the more recent post : http://stackoverflow.com/questions/18640305/how-to-keep-track-of-pip-installed-packages-in-an-anaconda-conda-env (there's quite some other posts where this is mentioned too so this feature is quite well-known by now). how stable that is remains to be tested though.

ricardobarroslourenco commented 8 years ago

Yes. On the link you provided, the guy points that it is possible to manage those dependencies either using only Pip or Anaconda:

  1. Install in your environment only the python, pip and distribute packages and manage everything with pip. (This is not that trivial if you're on Windows...)
  2. Build your own conda packages, and manage everything with conda.

Using our own conda package is interesting in terms that we could freeze our dependencies at the versions wanted, and install it all at once.

ghost commented 8 years ago

yes, you're right. i was focusing on the 'accepted' answer instead of the one with the most upvotes. i agree, using the 3rd option he points out is probably the best. of course we can also upload our conda packages to their (public) repo.

njmattes commented 8 years ago

Oh, this is interesting. This all makes it sound like conda is a very different beast than the conda of yesteryear.

ianfoster commented 8 years ago

I am probably not a good judge of such things, but I used to have terrible problems with Python dependencies until someone told me to use Conda. Now everything just works.

On Feb 22, 2016, at 1:57 PM, Nathan Matteson notifications@github.com<mailto:notifications@github.com> wrote:

Oh, this is interesting. This all makes it sound like conda is a very different beast than the conda of yesteryear.

— Reply to this email directly or view it on GitHubhttps://github.com/RDCEP/EDE/issues/11#issuecomment-187355042.

njmattes commented 8 years ago

I only tried conda once in 2013 probably, to manage the dependencies in webDICE which were pretty hairy. It was a weird beast back then. Being prone to the jerking of knees, I never tried it again. My loss apparently!