Giter Site home page Giter Site logo

pyomo-recipes's Introduction

pyomo-recipes

Useful conda recipes for Pyomo and dependencies.

Installation from conda packages

All the packages are uploaded to https://anaconda.org/cachemeorg/. To install everything:

conda install pyomo pyomo.extras pyomo.solvers --channel cachemeorg

Compilation from the recipes

To compile pyomo:

$ conda build pyutilib serpent pyro4 pyomo --python 3.5

To compile pyomo.extras:

conda build suds-jurko setproctitle openopt funcdesigner derapproximator pyomo.extras --python 3.5

To compile optional solvers:

conda build glpk --python 3.5
conda build ipopt_bin --python 3.5

pyomo-recipes's People

Contributors

astrojuanlu avatar whart222 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

hudan1992 arhao

pyomo-recipes's Issues

Patch openopt

There are some Python 2 failures, it would be nice to have that sorted before it bytes. It might be necessary to use 2to3.

Installing Pyomo Windows10

I am trying to install pyomo in Windows 10. My steps are:

Install Anaconda 2.7
Install Pyomo: conda install -c conda-forge pyomo
Install ipopt: conda install ipopt_bin --channel cachemeorg
But I am having the next error:

_Exception in thread Thread-6:
Traceback (most recent call last):
File "C:\Users\MC\Anaconda2\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Users\MC\Anaconda2\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\MC\Anaconda2\lib\site-packages\pyutilib\subprocess\processmngr.py", line 332, in _merged_reader
char = s.data.decode(encoding)
LookupError: unknown encoding: cp0

ERROR: "[base]\site-packages\pyomo\opt\base\solvers.py", 599, solve
Solver (asl) returned non-zero return code (-1073741510)
ERROR: "[base]\site-packages\pyomo\opt\base\solvers.py", 602, solve
See the solver log above for diagnostic information.
Traceback (most recent call last):

The program is working well from the terminal, but from spyder I get the error above. any idea?

Add support for Python2.7

Some packages, like Gurobi, only support Python 2.7. Can we automate the creation of packages for Python 2.7?

Pyro4 dependency

In Pyomo, we treat Pyro4 as an optional dependency that is installed with pyomo.extras, but in CAChemE it is treated as a required dependency for the pyomo package.

I'd like to understand this difference. We treat Pyro4 as an optional dependency since core Pyomo functionality doesn't depend on this package. Additionally, the installation of Pyro (and the other optional dependencies) has proven fragile using PyPI. For example, PyYAML and suds-jurko installations have failed due to external dependencies on their PyPI sites.

But perhaps things are different using conda, and it may make sense to install all/most of pyomo.extras as dependencies when Pyomo is installed with conda.

Windows 10 & Pyomo 4.2.10784 & Gurobi 6.5.1: Solver returns 'None' values

Hi everybody,

I had a weird error with your recipe on two Windows 10 X64 EDU installations:

Gurobi returns [None, None, ...] for the decision variables wheras other solvers e.g. "glpk" work fine. Gurobi itself is licensed and all Gurobi API examples are working. To the solver itself should be fine.

I reported and solved the problem here: https://groups.google.com/forum/#!topic/pyomo-forum/KrTMryO69f8

Short form: Installing the newest version (4.3.11388) via pip solved the problem for me.

Are you planning to provide the newest version in your recipe?

This would fix the error and using you recipe is more convenient than going the manual way.

Cheers
Cord

GLPK

The current recipe does not include the GLPK binaries in the system path:

[pyomo35] C:\Users\franz\Documents\GitHub\pyomo-instalacion\test_example\LP>pyomo solve --solver=glpk diet1.py diet.dat
[    0.00] Setting up Pyomo environment
[    0.00] Applying Pyomo preprocessing actions
[    0.01] Creating model
[    0.06] Applying solver
WARNING: "[base]\pyomo-4.2.10784-py3.5.egg\pyomo\solvers\plugins\solvers\GLPK_old.py", 68, executable
        Could not locate the 'glpsol' executable, which is required for solver 'glpk'
[    0.07] Pyomo Finished
ERROR: Unexpected exception while running model:
        No executable found for solver 'glpk'

Solution is to install GLPK with the following anaconda package:
https://anaconda.org/snorfalorpagus/glpk

conda install -c https://conda.anaconda.org/snorfalorpagus glpk

Pyomo en Windows10 ¿error encode?

Hola Juanlu,

Vuelvo a tener el mismo problema que te comenté hace unos meses. He instalado Pyomo en Windows10. Mi problema es que al optimizar un programita (que sé que tiene solución óptima porque en otro orde funciona correctamente) me encuentro con que:

  • Desde el command prompt encuentra solución óptima.
  • Desde spyder me salta el siguiente error:
    En la consola de ipython me sale:
Solver log file: 'C:\Users\MC\AppData\Local\Temp\tmpf9gmk_cs_ipopt.log'
Solver solution file: 'C:\Users\MC\AppData\Local\Temp\tmpm1p5q1iq.pyomo.sol'
Solver problem files: ('C:\\Users\\MC\\AppData\\Local\\Temp\\tmpm1p5q1iq.pyomo.nl',)
Exception in thread Thread-6:
Traceback (most recent call last):
  File "C:\Users\MC\Anaconda3\lib\threading.py", line 914, in _bootstrap_inner
    self.run()
  File "C:\Users\MC\Anaconda3\lib\threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\MC\Anaconda3\lib\site-packages\pyutilib\subprocess\processmngr.py", line 292, in _merged_reader
    encoding = sys.__stdout__.encoding
AttributeError: 'NoneType' object has no attribute 'encoding'

Y a la vez se me abre un cmd completamente negro: C:\Users\MC\Anaconda3\Library\bin\ipopt.exe

Al cerrar esta ventana de ipopt en la consola de ipython me sale:

  Signal handler called from  C:\Users\MC\Anaconda3\lib\subprocess.py wait 1271
  Waiting...
Traceback (most recent call last):

  File "<ipython-input-1-0aa7944467fe>", line 1, in <module>
    runfile('C:/Users/MC/program.py', wdir='C:/Users/MC/program.py')

  File "C:\Users\MC\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
    execfile(filename, namespace)

  File "C:\Users\MC\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/MC/program.py", line 640, in <module>
    results = solver_manager.solve(m, opt=opt, tee=True, keepfiles=True, symbolic_solver_labels=True)

  File "C:\Users\MC\Anaconda3\lib\site-packages\pyomo\opt\parallel\async_solver.py", line 33, in solve
    return self.execute(*args, **kwds)

  File "C:\Users\MC\Anaconda3\lib\site-packages\pyomo\opt\parallel\manager.py", line 106, in execute
    ah = self.queue(*args, **kwds)

  File "C:\Users\MC\Anaconda3\lib\site-packages\pyomo\opt\parallel\manager.py", line 121, in queue
    return self._perform_queue(ah, *args, **kwds)

  File "C:\Users\MC\Anaconda3\lib\site-packages\pyomo\opt\parallel\local.py", line 58, in _perform_queue
    results = opt.solve(*args, **kwds)

  File "C:\Users\MC\Anaconda3\lib\site-packages\pyomo\opt\base\solvers.py", line 588, in solve
    _status = self._apply_solver()

  File "C:\Users\MC\Anaconda3\lib\site-packages\pyomo\opt\solver\shellcmd.py", line 241, in _apply_solver
    self._rc, self._log = self._execute_command(self._command)

  File "C:\Users\MC\Anaconda3\lib\site-packages\pyomo\opt\solver\shellcmd.py", line 304, in _execute_command
    tee   = self._tee

  File "C:\Users\MC\Anaconda3\lib\site-packages\pyutilib\subprocess\processmngr.py", line 644, in run_command
    (' '.join(_cmd), err))

ApplicationError: Could not execute the command: 'C:\Users\MC\Anaconda3\Library\bin\ipopt.exe -s C:\Users\MC\AppData\Local\Temp\tmpm1p5q1iq.pyomo.nl halt_on_ampl_error=yes max_iter=3000'
	Error message: Interrupted by signal 2

Muchas gracias,

Un saludo, María

glpk solver not working

Hi everybody,

we have used your recipe to install Python, Pyomo and solvers in a university course and everything worked fine on all operating systems.

Now I have changed my own OS to Xubuntu 16.04 64 Bit and installed all packages on the newest Anaconda version via:

conda install pyomo pyomo.extras ipopt_bin glpk --channel cachemeorg

But now somehow I get a solver error (about a missing executable) when I execute a standard problem with glpk:

WARNING: "[base]/Pyomo-4.2.10784-py3.5.egg/pyomo/solvers/plugins/solvers/GLPK_old.py", 68, executable
Could not locate the 'glpsol' executable, which is required for solver 'glpk'
Traceback (most recent call last):

...

ApplicationError: No executable found for solver 'glpk'

Using

conda list

yields

derapproximator           0.52                    py35_10    cachemeorg
...
funcdesigner              0.5620                  py35_10    cachemeorg
...
glpk                      4.57                         10    cachemeorg
...
ipopt_bin                 3.7.1                        10    cachemeorg
... 
openopt                   0.5625                  py35_10    cachemeorg
...
pyomo                     4.2.10784               py35_10    cachemeorg
pyomo.extras              2.0                     py35_10    cachemeorg
...
pyro4                     4.41                    py35_10    cachemeorg
... 
pyutilib                  5.2.3601                py35_10    cachemeorg
...
serpent                   1.12                    py35_10    cachemeorg
setproctitle              1.1.9                   py35_10    cachemeorg
...
suds-jurko                0.6                     py35_10    cachemeorg
...

So the glpk package seems to be there.

Is this a bug or am I missing something?

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.