3

I want to solve an optimization problem with pyomo in a virtual conda-environment. I installed pyomo and the glpk-Solver with "conda install-n envname packagename". When I test the solver I get the following error:

(venvconda) C:\Users\XXX\Synergy-Site>pyomo test-solvers glpk

Traceback (most recent call last):

File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\venvconda\Scripts\pyomo-script.py", line 10, in <module>
    sys.exit(main())
  File "\\xxxx\Anwendungsdaten\Python\Python37\site-packages\pyomo\scripting\pyomo_main.py", line 82, in main
    retval = _options.func(_options)
  File "\\xxxx\Anwendungsdaten\Python\Python37\site-packages\pyomo\opt\plugins\driver.py", line 31, in test_exec
    pyomo.solvers.tests.testcases.run_test_scenarios(options)
  File "\\xxxx\Anwendungsdaten\Python\Python37\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 "\\xxxx\Anwendungsdaten\Python\Python37\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: '\\\\xxxx\\Anwendungsdaten\\Python\\Python37\\site-packages\\pyomo\\solvers\\tests\\models\\LP_block.json'
Jasurbek
  • 2,946
  • 3
  • 20
  • 37
ni33na
  • 31
  • 2

1 Answers1

1

The test-solvers script is pretty old so I would recommend trying to solve a small model as a way to test your installation instead of using the test-solvers script. You can check if GLPK is installed correctly by running the command glpsol in your Anaconda prompt. You should see output like the following:

$ glpsol
GLPSOL: GLPK LP/MIP Solver, v4.62
No input problem file specified; try glpsol --help

A small Pyomo model to test your installation can be found here

Bethany Nicholson
  • 2,723
  • 1
  • 11
  • 18