Installing Pyomo with Conda

458 views
Skip to first unread message

Bill Hart

unread,
Jul 1, 2016, 2:53:49 PM7/1/16
to Pyomo Developers
Hi, all:

I've been experimenting with the use of Conda to install Pyomo and other Python package that can be leveraged by Pyomo.

For example, if Conda is installed, then you can run the following command to install Pyomo:

  conda install -c https://conda.anaconda.org/conda-forge pyomo

This installs Pyomo from the conda-forge channel, which is where I've been setting up Conda packages.  Similarly, the following command installs a variety of other Python packages that Pyomo relies on (pyyaml, numpy, openpyxl, etc):

  conda install -c https://conda.anaconda.org/conda-forge pyomo.extras

Before advertising this capability to end-users, I'd like to get some input on its use by developers.  Can you guys try out this installation mechanism and give me some feedback?

Conda is installed with the Anaconda Python distribution, but not with other Python distros.  I've had occasionally difficulties installing and updating Conda with 'pip'.  I'm curious if anyone else has similar problems.

FYI, the pyomo.extras Conda package is particularly useful for end-users.  Currently, users can use pip to do a similar installation:

  pip install pyomo.extras

But this is MUCH more fragile than Conda.  If any package fails to install, then pip terminates.  And PyPi doesn't ensure that packages are available the same way that Conda does.  Hence, pip is inherently more fragile.

My expectation is that we'll be able to advertise a single installation command for users, after which many Pyomo extensions will work.  For example, after installing

    conda install -c https://conda.anaconda.org/conda-forge pyomo pyomo.extras

the NEOS solvers work, YAML files work, you can load data from Excel files, etc.

--Bill

David Woodruff

unread,
Jul 3, 2016, 10:31:09 AM7/3/16
to pyomo-de...@googlegroups.com
Bill,
  I tried it and it worked extremely well. I installed Anaconda's Python 3.5 first.

Important aside: In the past, I (and others as reported on the web) have had trouble with Anaconda's version of Pyro4 under Pyth3.4, but as of Python3.5, that seems to have gone away, at least for me.

Bottom line: based on a sample size of one, I would say it is a great thing.
  Dave


--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Woodruff

unread,
Aug 10, 2016, 8:10:36 PM8/10/16
to pyomo-de...@googlegroups.com
This, in turn, makes it nearly trivial to create a docker image for Pyomo.
Here's such a Dockerfile (the comment on use
assumes you created the image using
sudo docker build -t pyomodocker .
)

# DLW makes a pyomo docker image
# to try it out you could do, e.g., run -i -t pyomodocker /bin/bash
# or, more importantly, you could build other images from it
FROM continuumio/anaconda3:latest
MAINTAINER David L. Woodruff
RUN conda install -c https://conda.anaconda.org/conda-forge pyomo pyomo.extras

On Fri, Jul 1, 2016 at 11:53 AM, Bill Hart <whar...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.

Bill Hart

unread,
Aug 23, 2016, 8:57:10 AM8/23/16
to Pyomo Developers, dlwoo...@ucdavis.edu
This is totally cool!
Reply all
Reply to author
Forward
0 new messages