Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyomo test-solvers errors #861

Open
andregirard opened this issue Feb 12, 2019 · 7 comments
Open

Pyomo test-solvers errors #861

andregirard opened this issue Feb 12, 2019 · 7 comments
Assignees
Labels
bug pyomo.installation Any issues related to installation of pyomo

Comments

@andregirard
Copy link

andregirard commented Feb 12, 2019

I have a working installation of Pyomo. I now want to install some solvers following the instructions at

https://pyomo.readthedocs.io/en/latest/installation.html#using-conda

I installed the standard solvers with

conda install -c conda-forge ipopt coincbc glpk
Collecting package metadata: done
Solving environment: done

Package Plan

  environment location: /home/andre/anaconda3

  added / updated specs:
    - coincbc
    - glpk
    - ipopt


The following packages will be UPDATED:

  glpk                      pkgs/main::glpk-4.65-h3ceedfd_2 --> conda-forge::glpk-4.65-ha14ba45_1001


Proceed ([y]/n)? 

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
``
I then run 
``
pyomo test-solvers
``
and get 
``
Traceback (most recent call last):
  File "/home/andre/anaconda3/bin/pyomo", line 11, in <module>
    sys.exit(main())
  File "/home/andre/anaconda3/lib/python3.6/site-packages/pyomo/scripting/pyomo_main.py", line 82, in main
    retval = _options.func(_options)
  File "/home/andre/anaconda3/lib/python3.6/site-packages/pyomo/opt/plugins/driver.py", line 31, in test_exec
    pyomo.solvers.tests.testcases.run_test_scenarios(options)
  File "/home/andre/anaconda3/lib/python3.6/site-packages/pyomo/solvers/tests/testcases.py", line 353, in run_test_scenarios
    rc = model_class.validate_current_solution(suffixes=model_class.test_suffixes)
  File "/home/andre/anaconda3/lib/python3.6/site-packages/pyomo/solvers/tests/models/base.py", line 205, in validate_current_solution
    with open(self.results_file,'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/andre/anaconda3/lib/python3.6/site-packages/pyomo/solvers/tests/models/LP_block.json'`

Sure enough, the file is not there

~/anaconda3/lib/python3.6/site-packages/pyomo/solvers/tests/models$ ls
base.py                    
LP_unique_duals.py
__init__.py                
LP_unused_vars.py
LP_block.py                
MILP_discrete_var_bounds.py
MILP_infeasible1.py
LP_constant_objective1.py  
MILP_simple.py
LP_constant_objective2.py  
MILP_unbounded.py
LP_duals_maximize.py       
MILP_unused_vars.py
LP_duals_minimize.py       
MIQCP_simple.py
LP_inactive_index.py       
MIQP_simple.py
LP_infeasible1.py          
__pycache__
LP_infeasible2.py          
QCP_simple.py
LP_piecewise.py            
QP_constant_objective.py
LP_simple.py               
QP_simple.py
LP_trivial_constraints.py  
SOS1_simple.py
LP_unbounded.py            
SOS2_simple.py
@blnicho
Copy link
Member

blnicho commented Feb 12, 2019

I'm not sure what the test-solvers option does but if you just want to check which solvers are available to Pyomo, use the command:

pyomo help -s

@andregirard
Copy link
Author

Test-solver seems to run some test on a set of problems to check the installation.

I have been able to use Pyomo to solve some simple problems so this is no longer an issue for me.

@jsiirola
Copy link
Member

I am reopening this. This is a definite issue with packaging in Pyomo. Clearly, the test-solvers command has never been used by anyone that did not work with a checkout of the pyomo source installed with setup-develop. I believe it is a relatively easy fix to setup.py to get it to include the necessary JSON files as part of the distribution.

In the future, we should revisit the design / utility of test-solvers to see if it is something that is really useful to users and if there is a better way to distribute the models/reference files to support things like this.

@jsiirola jsiirola reopened this Feb 14, 2019
@blnicho blnicho added bug pyomo.installation Any issues related to installation of pyomo labels Feb 15, 2019
@mrmundt
Copy link
Contributor

mrmundt commented May 27, 2020

@jsiirola - Are there any other JSON files that need to be included in the packaging? With the current setup.py configuration, there are no json, ui, or any other types of non-Python files being grabbed.

@mrmundt mrmundt self-assigned this May 27, 2020
@jsiirola
Copy link
Member

Updating packaging is going to be involved, and will probably involve a PEP to define what should be included in, e.g., the wheels. I am not entirely sure that adding the testing data and baselines into the distribution is a good idea.

Separately, I just tried pyomo test-solvers with a checkout of master, and the tests failed with a missing LP_unbounded.json. This indicates that pyomo test-solvers doesn't work at all (and may not have worked for quite some time). This raises the question as to if the ultimate resolution of this specific issue is to remove the pyomo test-solvers sub-command entirely.

@milindsmart
Copy link

Just want to add my vote to resolve this as well. I was trying to test SCIP which I built from source, and this error almost misdirected me towards worrying about whether I missed something while compiling.

@blnicho
Copy link
Member

blnicho commented Sep 26, 2023

pyomo test-solvers has been broken for some time. We need to decide on a path forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pyomo.installation Any issues related to installation of pyomo
Projects
None yet
Development

No branches or pull requests

5 participants