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

tried gurobi solver for opf - error at the start #77

Open
angelinasyrri opened this issue Apr 12, 2022 · 2 comments
Open

tried gurobi solver for opf - error at the start #77

angelinasyrri opened this issue Apr 12, 2022 · 2 comments

Comments

@angelinasyrri
Copy link

Hi! I have installed Gurobi as an additional solver according to the instructions provided in https://pandapower.readthedocs.io/en/develop/opf/powermodels.html#additional-solvers.

When trying to perform the first basic test 'pp.runpm_ac_opf(net, pm_model="ACPPowerModel", pm_solver="gurobi")', I get the following error:

**_File "C:\Users...l\AppData\Local\Temp\ipykernel_1508\1602319788.py", line 1, in <cell line: 1>
pp.runpm_ac_opf(net, pm_model="ACPPowerModel", pm_solver="gurobi")

File "C:\Users...\development\work_env_spyder\lib\site-packages\pandapower\runpm.py", line 134, in runpm_ac_opf
_runpm(net, delete_buffer_file=delete_buffer_file, pm_file_path=pm_file_path, pdm_dev_mode=pdm_dev_mode)

File "C:\Users...\development\work_env_spyder\lib\site-packages\pandapower\opf\run_powermodels.py", line 34, in _runpm
result_pm = _call_pandamodels(buffer_file, net._options["julia_file"], pdm_dev_mode)

File "C:\Users...\development\work_env_spyder\lib\site-packages\pandapower\opf\run_powermodels.py", line 88, in _call_pandamodels
result_pm = Main.eval(julia_file + "(buffer_file)")

File "C:\Users...\development\work_env_spyder\lib\site-packages\julia\core.py", line 621, in eval
ans = self._call(src)

File "C:\Users...\development\work_env_spyder\lib\site-packages\julia\core.py", line 549, in _call
self.check_exception(src)

File "C:\Users...\development\work_env_spyder\lib\site-packages\julia\core.py", line 603, in check_exception
raise JuliaError(u'Exception '{}' occurred while calling julia code:\n{}'

JuliaError: Exception 'UndefVarError: Gurobi not defined' occurred while calling julia code:
run_powermodels_opf(buffer_file)_**

Thanks in advance for the help!

@ZhengLiu1119
Copy link
Member

hello angelinasyrri,

I am very sorry for the really late answer. Our colleague who was in charge of PowerModels has been away for serval months, and I took over the tasks only a few weeks ago.

The reason for the error is that "gurobi" is not successfully imported in PandaModels. I will update the version this week, and it should work well with gurobi.

best

zheng

@angelinasyrri
Copy link
Author

Thank you very much Zheng!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants