Closed yasirroni closed 1 year ago
Firstly, this seems to be a pyomo error, so I think you should report it there first.
mamba seems to work fine for cyipopt for me on linux (we test the conda binaries on all operating systems):
examples(master)$ mamba create -n cyipopt-test python pip cyipopt
__ __ __ __
/ \ / \ / \ / \
/ \/ \/ \/ \
███████████████/ /██/ /██/ /██/ /████████████████████████
/ / \ / \ / \ / \ \____
/ / \_/ \_/ \_/ \ o \__,
/ _/ \_____/ `
|/
███╗ ███╗ █████╗ ███╗ ███╗██████╗ █████╗
████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
██╔████╔██║███████║██╔████╔██║██████╔╝███████║
██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
██║ ╚═╝ ██║██║ ██║██║ ╚═╝ ██║██████╔╝██║ ██║
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝
mamba (1.4.0) supported by @QuantStack
GitHub: https://github.com/mamba-org/mamba
Twitter: https://twitter.com/QuantStack
█████████████████████████████████████████████████████████████
Looking for: ['python', 'pip', 'cyipopt']
conda-forge/noarch 11.8MB @ 4.3MB/s 3.1s
conda-forge/linux-64 30.6MB @ 4.6MB/s 7.7s
Transaction
Prefix: /home/moorepants/miniconda/envs/cyipopt-test
Updating specs:
- python
- pip
- cyipopt
Package Version Build Channel Size
──────────────────────────────────────────────────────────────────────────────────────────
Install:
──────────────────────────────────────────────────────────────────────────────────────────
+ _libgcc_mutex 0.1 conda_forge conda-forge/linux-64 Cached
+ _openmp_mutex 4.5 2_gnu conda-forge/linux-64 Cached
+ ampl-mp 3.1.0 h2cc385e_1006 conda-forge/linux-64 Cached
+ bzip2 1.0.8 h7f98852_4 conda-forge/linux-64 Cached
+ ca-certificates 2022.12.7 ha878542_0 conda-forge/linux-64 Cached
+ cyipopt 1.2.0 py311hd28d000_1 conda-forge/linux-64 138kB
+ ipopt 3.14.11 hf9e1ecf_0 conda-forge/linux-64 Cached
+ ld_impl_linux-64 2.40 h41732ed_0 conda-forge/linux-64 Cached
+ libblas 3.9.0 16_linux64_openblas conda-forge/linux-64 Cached
+ libcblas 3.9.0 16_linux64_openblas conda-forge/linux-64 Cached
+ libedit 3.1.20191231 he28a2e2_2 conda-forge/linux-64 Cached
+ libexpat 2.5.0 hcb278e6_1 conda-forge/linux-64 Cached
+ libffi 3.4.2 h7f98852_5 conda-forge/linux-64 Cached
+ libgcc-ng 12.2.0 h65d4601_19 conda-forge/linux-64 Cached
+ libgfortran-ng 12.2.0 h69a702a_19 conda-forge/linux-64 Cached
+ libgfortran5 12.2.0 h337968e_19 conda-forge/linux-64 Cached
+ libgomp 12.2.0 h65d4601_19 conda-forge/linux-64 Cached
+ libiconv 1.17 h166bdaf_0 conda-forge/linux-64 Cached
+ liblapack 3.9.0 16_linux64_openblas conda-forge/linux-64 Cached
+ libnsl 2.0.0 h7f98852_0 conda-forge/linux-64 Cached
+ libopenblas 0.3.21 pthreads_h78a6416_3 conda-forge/linux-64 Cached
+ libsqlite 3.40.0 h753d276_0 conda-forge/linux-64 Cached
+ libstdcxx-ng 12.2.0 h46fd767_19 conda-forge/linux-64 Cached
+ libuuid 2.38.1 h0b41bf4_0 conda-forge/linux-64 Cached
+ libzlib 1.2.13 h166bdaf_4 conda-forge/linux-64 Cached
+ metis 5.1.0 h58526e2_1006 conda-forge/linux-64 Cached
+ mumps-include 5.2.1 ha770c72_11 conda-forge/linux-64 Cached
+ mumps-seq 5.2.1 h2104b81_11 conda-forge/linux-64 Cached
+ ncurses 6.3 h27087fc_1 conda-forge/linux-64 Cached
+ numpy 1.24.2 py311h8e6699e_0 conda-forge/linux-64 Cached
+ openssl 3.1.0 h0b41bf4_0 conda-forge/linux-64 Cached
+ pip 23.0.1 pyhd8ed1ab_0 conda-forge/noarch Cached
+ python 3.11.2 h2755cc3_0_cpython conda-forge/linux-64 Cached
+ python_abi 3.11 3_cp311 conda-forge/linux-64 Cached
+ readline 8.2 h8228510_1 conda-forge/linux-64 Cached
+ scotch 6.0.9 hb2e6521_2 conda-forge/linux-64 Cached
+ setuptools 67.6.1 pyhd8ed1ab_0 conda-forge/noarch Cached
+ tk 8.6.12 h27826a3_0 conda-forge/linux-64 Cached
+ tzdata 2023c h71feb2d_0 conda-forge/noarch Cached
+ unixodbc 2.3.10 h583eb01_0 conda-forge/linux-64 Cached
+ wheel 0.40.0 pyhd8ed1ab_0 conda-forge/noarch Cached
+ xz 5.2.6 h166bdaf_0 conda-forge/linux-64 Cached
+ zlib 1.2.13 h166bdaf_4 conda-forge/linux-64 Cached
Summary:
Install: 43 packages
Total download: 138kB
──────────────────────────────────────────────────────────────────────────────────────────
cyipopt 138.5kB @ 412.9kB/s 0.3s
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
To activate this environment, use
$ mamba activate cyipopt-test
To deactivate an active environment, use
$ mamba deactivate
examples(master)$ act cyipopt-test
(cyipopt-test) examples(master)$ ls
exception_handling.py hs071.py hs071_scipy_jax.py lasso.py rosen.py
(cyipopt-test) examples(master)$ python hs071.py
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit https://github.com/coin-or/Ipopt
******************************************************************************
This is Ipopt version 3.14.11, running with linear solver MUMPS 5.2.1.
Number of nonzeros in equality constraint Jacobian...: 4
Number of nonzeros in inequality constraint Jacobian.: 4
Number of nonzeros in Lagrangian Hessian.............: 10
Total number of variables............................: 4
variables with only lower bounds: 0
variables with lower and upper bounds: 4
variables with only upper bounds: 0
Total number of equality constraints.................: 1
Total number of inequality constraints...............: 1
inequality constraints with only lower bounds: 1
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 0
Objective value at iteration #0 is - 16.1097
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
0 1.6109693e+01 1.12e+01 1.02e+00 0.0 0.00e+00 - 0.00e+00 0.00e+00 0
Objective value at iteration #1 is - 17.3461
1 1.7346108e+01 7.50e-01 2.37e+01 -0.3 7.22e-01 - 3.51e-01 1.00e+00f 1
Objective value at iteration #2 is - 17.9222
2 1.7922201e+01 7.70e-03 5.29e+00 -0.2 6.00e-02 2.0 9.96e-01 1.00e+00h 1
Objective value at iteration #3 is - 17.1673
3 1.7167308e+01 6.72e-02 1.66e+00 -0.8 1.37e+00 - 9.95e-01 6.98e-01f 1
Objective value at iteration #4 is - 16.9893
4 1.6989299e+01 1.02e-01 1.47e-01 -1.2 2.30e-01 - 9.92e-01 1.00e+00f 1
Objective value at iteration #5 is - 16.9944
5 1.6994402e+01 3.39e-02 1.19e-02 -2.3 8.69e-02 - 9.84e-01 1.00e+00h 1
Objective value at iteration #6 is - 17.014
6 1.7013957e+01 2.20e-04 3.14e-04 -3.8 1.15e-02 - 9.99e-01 1.00e+00h 1
Objective value at iteration #7 is - 17.014
7 1.7014017e+01 6.30e-07 1.31e-06 -9.7 3.43e-04 - 9.99e-01 9.99e-01h 1
Objective value at iteration #8 is - 17.014
8 1.7014017e+01 5.61e-13 8.50e-13 -11.0 5.69e-07 - 1.00e+00 1.00e+00h 1
Number of Iterations....: 8
(scaled) (unscaled)
Objective...............: 3.4028034280427242e+01 1.7014017140213621e+01
Dual infeasibility......: 8.5010828358650403e-13 4.2505414179325202e-13
Constraint violation....: 5.6132876125047915e-13 5.6132876125047915e-13
Variable bound violation: 9.9952566223748818e-09 9.9952566223748818e-09
Complementarity.........: 1.1688338037511438e-11 5.8441690187557189e-12
Overall NLP error.......: 1.1688338037511438e-11 5.8441690187557189e-12
Number of objective function evaluations = 9
Number of objective gradient evaluations = 9
Number of equality constraint evaluations = 9
Number of inequality constraint evaluations = 9
Number of equality constraint Jacobian evaluations = 9
Number of inequality constraint Jacobian evaluations = 9
Number of Lagrangian Hessian evaluations = 8
Total seconds in IPOPT = 0.016
EXIT: Optimal Solution Found.
Solution of the primal variables: x=array([0.99999999, 4.74299964, 3.82114998, 1.37940829])
Solution of the dual variables: lambda=array([-0.55229366, 0.16146856])
Objective=17.01401714021362
Weird,
(pyopf) ...>python examples\check_ipopt.py ****************************************************************************** This program contains Ipopt, a library for large-scale nonlinear optimization. Ipopt is released as open source code under the Eclipse Public License (EPL). For more information visit https://github.com/coin-or/Ipopt ****************************************************************************** This is Ipopt version 3.14.11, running with linear solver MUMPS 5.2.1. Number of nonzeros in equality constraint Jacobian...: 4 Number of nonzeros in inequality constraint Jacobian.: 4 Number of nonzeros in Lagrangian Hessian.............: 10 Total number of variables............................: 4 variables with only lower bounds: 0 variables with lower and upper bounds: 4 variables with only upper bounds: 0 Total number of equality constraints.................: 1 Total number of inequality constraints...............: 1 inequality constraints with only lower bounds: 1 inequality constraints with lower and upper bounds: 0 inequality constraints with only upper bounds: 0 Objective value at iteration #0 is - 16.1097 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 0 1.6109693e+01 1.12e+01 1.02e+00 0.0 0.00e+00 - 0.00e+00 0.00e+00 0 Objective value at iteration #1 is - 17.3461 1 1.7346108e+01 7.50e-01 2.37e+01 -0.3 7.22e-01 - 3.51e-01 1.00e+00f 1 Objective value at iteration #2 is - 17.9222 2 1.7922201e+01 7.70e-03 5.29e+00 -0.2 6.00e-02 2.0 9.96e-01 1.00e+00h 1 Objective value at iteration #3 is - 17.1673 3 1.7167308e+01 6.72e-02 1.66e+00 -0.8 1.37e+00 - 9.95e-01 6.98e-01f 1 Objective value at iteration #4 is - 16.9893 4 1.6989299e+01 1.02e-01 1.47e-01 -1.2 2.30e-01 - 9.92e-01 1.00e+00f 1 Objective value at iteration #5 is - 16.9944 5 1.6994402e+01 3.39e-02 1.19e-02 -2.3 8.69e-02 - 9.84e-01 1.00e+00h 1 Objective value at iteration #6 is - 17.014 6 1.7013957e+01 2.20e-04 3.14e-04 -3.8 1.15e-02 - 9.99e-01 1.00e+00h 1 Objective value at iteration #7 is - 17.014 7 1.7014017e+01 6.30e-07 1.31e-06 -9.7 3.43e-04 - 9.99e-01 9.99e-01h 1 Objective value at iteration #8 is - 17.014 8 1.7014017e+01 5.61e-13 8.47e-13 -11.0 5.69e-07 - 1.00e+00 1.00e+00h 1 Number of Iterations....: 8 (scaled) (unscaled) Objective...............: 3.4028034280427242e+01 1.7014017140213621e+01 Dual infeasibility......: 8.4655556991432098e-13 4.2327778495716049e-13 Constraint violation....: 5.6132876125047915e-13 5.6132876125047915e-13 Variable bound violation: 9.9952566223748818e-09 9.9952566223748818e-09 Complementarity.........: 1.1688338037076061e-11 5.8441690185380307e-12 Overall NLP error.......: 1.1688338037076061e-11 5.8441690185380307e-12 Number of objective function evaluations = 9 Number of objective gradient evaluations = 9 Number of equality constraint evaluations = 9 Number of inequality constraint evaluations = 9 Number of equality constraint Jacobian evaluations = 9 Number of inequality constraint Jacobian evaluations = 9 Number of Lagrangian Hessian evaluations = 8 Total seconds in IPOPT = 0.157 EXIT: Optimal Solution Found. Solution of the primal variables: x=array([0.99999999, 4.74299964, 3.82114998, 1.37940829]) Solution of the dual variables: lambda=array([-0.55229366, 0.16146856]) Objective=17.01401714021362
(pyopf) C:\Data\Git\PyOPF>python examples\acopf_pglib.py
build model... end
instantiate model... end
WARNING: Could not locate the 'ipopt' executable, which is required for solver
ipopt
Traceback (most recent call last):
File ""...\examples\acopf_pglib.py", line 7, in <module>
result = model.solve(solver='ipopt',
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ""...\opf\core\base.py", line 49, in solve
return self._solve(optimizer, solve_method, tee, extract_dual)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ""...\opf\core\base.py", line 85, in _solve
opt_results = optimizer.solve(self.instance, tee=tee)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mambaforge\envs\pyopf\Lib\site-packages\pyomo\opt\base\solvers.py", line 513, in solve
self.available(exception_flag=True)
File "...\mambaforge\envs\pyopf\Lib\site-packages\pyomo\opt\solver\shellcmd.py", line 139, in available
raise ApplicationError(msg % self.name)
pyomo.common.errors.ApplicationError: No executable found for solver 'ipopt'
Solved by manually add the path to environment variable ...\Ipopt-3.13.3-win64-msvs2019-md\bin
and restart PC.
Using mamba, I got this error:
I use this yml file to create env