I am using Pyomo 5.6.8 and trying to resolve a non linear optimization problem using MindtPySolver.
I have no issue on my local machine, simply calling the solve method with these arguments:
SolverFactory('mindtpy').solve(model, mip_solver='cbc', nlp_solver='ipopt')
However, when I go cloud on Azure, Pyomo doesn't get the path to the CBC and IPOPT solvers. When needing to resolve a problem that is linear, I can bypass the issue using the following command, by adding executable argument when creating SolverFactory instance with a LP solver:
SolverFactory("cbc", executable="/path/to/my/virtual/env/bin/cbc")
In my non-linear programming case, MindtpySolver doesn't accept additional argument. I looked at the doc & source code and couldn't find option to specify solver path, that is unfortunately not recognized by default on my Azure environment.
I tried to pass options using the "solver_args" options found on source code like this:
SolverFactory('mindtpy').solve(
model,
nlp_solver_args={
"executable": "/path/to/my/virtual/env/bin/ipopt"
},
mip_solver_args={
"executable": "/path/to/my/virtual/env/bin/cbc"
},
mip_solver='cbc', nlp_solver='ipopt',
)
But I'm still getting "WARNING: Could not locate the 'ipopt' executable, which is required for solver" like errors. I insist on the fact that all solvers (here cbc and ipopt) can be found in my virtual environment.
Is there a way to specify solvers path using MindtPySolver?
I may have same issue too, My optimize problem is Mixed-Integer Nonlinear Programs, and it have to using "SolverFactory('mindtpy').solve(model, mip_solver='glpk', nlp_solver='ipopt')" And the solver is in Django Framework with Apache2 WSGI Service which WSGIDaemonProcess : Conda Env.
When call api via Web Browser. It will rise error like cannot find "ipopt" solver. and "glpk" solver too. and SolverFactory allow us set only one Executable.
BTW, Already find out how to fix it.
After you install ipopt and plugin solver via Conda install.
Just going deep in python package and edit raw file.
My path are below:
/home/user/miniconda3/envs/py385/lib/python3.8/site-packages/pyomo/solvers/plugins/solvers/GLPK.py
/home/user/miniconda3/envs/py385/lib/python3.8/site-packages/pyomo/solvers/plugins/solvers/IPOPT.py
Find function below and change it.
def _default_executable(self):
executable = Executable('/home/user/miniconda3/envs/py385/bin/glpsol')
def _default_executable(self):
executable = Executable("/home/user/miniconda3/envs/py385/bin/ipopt")
You can find where is plugin solver located by type in terminal command
"which ipopt", "which glpsol"
Related
I download openflow. It successfully been built. However, only scenario_Small is correctly working, when try to run other scenarios error runtime appears such as that:
Cannot add statistic 'numOutOfOrderArrivals' to module MultiController.Vancouver.client[0].pingApp[0] (NED type: openflow.apps.PingAppRandom): Error in source=numOutOfOrderArrivals: Signal 'numOutOfOrderArrivals' is not declared on type 'openflow.apps.PingAppRandom' (you can turn off this check by adding checkSignals=false to the #statistic property in the NED file) -- in module (PingAppRandom) MultiController.Vancouver.client[0].pingApp[0] (id=161), during network setup
when trying to run "szenario_Domains_multiController"
I tried to fix the error following the hint mentioned in error, but another errors appeared. How to fix those endless errors.
It seems that the codebase of this openflow project is already old and does not correspond to the new builds of OmNET++ and the INET framework.
I was success to build and run test scenarios from this project on Win 10 and OmNET++ 5.6.2 and INET 3.6.6.
I encountered the following problem when I was trying to run the code from Fast and Safe Trajectory Planner for Flights in Unknown Environments
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find GUROBI (missing: GUROBI_LIBRARY)
I think I followed all the instructions correctly and the file ~/.bashrc is appended with the following statements:
source /opt/ros/melodic/setup.bash
export GUROBI_HOME="/home/zjnyly/Desktop/gurobi911/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
export GRB_LICENSE_FILE="/home/zjnyly/gurobi.lic"
source /home/zjnyly/Desktop/ws//devel/setup.bash
I then tried to change the version of gurobi manully in FindGUROBI.cmake file, but I don't know how to correctly write it.
(the version of gurobi on my computer is 9.1.1)
find_library(GUROBI_LIBRARY
NAMES gurobi gurobi91
HINTS ${GUROBI_DIR} $ENV{GUROBI_HOME}
PATH_SUFFIXES lib)
I'm new to this field and I don't know much about these things. I'd appreciate it if you could help me. Thanks!
I guess you did not set your environment variables correctly, please check.
As the work only tested in Ubuntu 16.04/ROS Kinetic, Ubuntu 18.04/ROS Melodic and
Gurobi 8.1, Gurobi 9.0, and Gurobi 9.1. so use the relevant version.
I have installed gurobi, however it does not get reflected when importing.
I get the following error:
No module name gurobi
You didn't write which API you are using. If you are using python, you should use import gurobipy and not gurobi. You also need to setup some environment variables (GUROBI_HOME, PATH and LD_LIBRARY_PATH). See Gurobi quick start guide.
We're evaluating noflo to be executed on an embedded linux box using an simple javascript engine, being an interpreter (no JIT). In our case, the Node.js engine (with embedded V8 engine) might be too resource intensive.
The immediate question is the how to run the noflo runtime in there. Checking out the GitHub repository (https://github.com/noflo/noflo) and using grunt, we have generated the noflo for the browser using grunt build:browser.
As simple example to actually try and run the generated browser/noflo.js file, I used the d8 shell (V8 engine shell) for an isolated Javascript engine outside the Node.js universe, and appended the following code to the noflo.js generated file:
var fbpData = "<some FBP language connections>";
var noflo = require('noflo');
noflo.graph.loadFbp(fbpData, function(graph) {
print("Graph loaded");
});
Then,
d8 noflo.js
on the Linux shell, which reports
rtm.js:9559: TypeError: undefined is not a function
noflo.graph.loadFbp(fbpData, function(graph) {
^
TypeError: undefined is not a function
at rtm.js:9559:13
Without knowing further, leads me to believe that the noflo.js is not self-contained with all core noflo runtime functionality.
What necessary steps are missing here, for me to get noflo library running in an isolated JS engine (V8 is just an example - it could be any engine the is ECMA V5 compliant)
All code examples on the noflo project web site are tailored for Node.js...
PS: I tried as an alternative to build a browser-based noflo from http://noflojs.org/download/, however this always returns "server error".
Best regards
Gunther Strube
The NoFlo-Gnome project contains a browser build of the noflo-runtime-base repository (https://github.com/noflo/noflo-runtime-base) which itself embeds NoFlo.
You might need to add some aliases because the browser build doesn't necessarily fit your engine : https://github.com/noflo/noflo-gnome/blob/master/src/noflo.js#L89
noflo-gnome runs NoFlo in GJS, which is based on Spidermonkey and GLib/GObject.
It has some minimal require() compatibility which allows pulling in NoFlo. There is a checked in build of noflo (+ noflo-runtime-base) in ./src/libs but I did not immediately find how this is created.
If you're considering using a browser build to speed up the startup time, you might also want to look at : https://github.com/djdeath/noflo-iot
At some point I tried to run NoFlo on a board with very slow I/O. It turned out that a single file compacted build of NoFlo (including all the needed components) was significantly faster.
I'm trying to use ogr2ogr to filter a shapefile. I'm working through Mike Bostock's Let's Make a Map tutorial. A bit of googling - including here - hasn't led to any solutions yet. I'm also VERY new to topojson (and shapefiles in general; my background is in economics/statistical software like Stata), so I'm not sure what I'm doing and where things are going wrong. Either way - here's the error result I'm getting:
dyld: Library not loaded: /usr/local/lib/liblwgeom-2.1.1.dylib
Referenced from: /usr/local/Cellar/libspatialite/4.1.1/lib/libspatialite.5.dylib
Reason: image not found
Trace/BPT trap: 5
No idea what liblwgeom-2.1.1.dylib is, what it does, where I get it, etc. Google hasn't helped much on defining it either.
FWIW, I'm on a Mac, I brew installed npm and gdal, and then npm installed topojson.
Thanks,
a
Edited to add: I just brew reinstalled gdal, because I remembered getting a warning (Caveats). See below:
==> Caveats
For non-homebrew python (2.x), you need to amend your PYTHONPATH like so:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
This version of GDAL was built with Python support. In addition to providing
modules that makes GDAL functions available to Python scripts, the Python
binding provides additional command line tools.
I actually tried to run export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH literally as-is, and it returned nothing. (Not sure if something happened in the background?) Basically fumbling in the dark!