Solving PyPSA model with Gurobi in Google Colab - License problem
回答済みHello!
I am trying to solve an optimization problem with PyPSA in Google Colab using Gurobi as solver, which normally works perfectly fine on my local computer. When I try to run this in Google Colab I always receive the error of the size-limited license, although I have the correct non-size-limited academic license.
Before trying to run this in Google Colab I followed the steps indicated in the post "Google Colab: Installation and Licensing". The problem is that the model to be optimized is inside PyPSA and must not be created by myself with a line like
model = gp.Model(env=e)
as indicated in the aforementioned post.
So what I need is to find out how to make the model run in the correct environment.
I have run these lines of code to create the environment:
e = gp.Env(empty=True)
e.setParam('WLSACCESSID', 'your wls accessid (string)')
e.setParam('WLSSECRET', 'your wls secret (string)')
e.setParam('LICENSEID', <your license id (integer)>)
e.start()
And I use this dictionary to pass specify some parameters for the Gurobi Solver:
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Sebastian,
Unfortunately, I think PyPSA uses Pyomo internally, which creates a default environment for you, so you cannot use the method you described.
Try saving the license file to be accessible through your Google Colab instance and setting the \(\texttt{GRB_LICENSE_FILE}\) to point to this file (use the full path).
Cheers,
David0 -
Hello David,
Thank you for your answer.
Regards,
Sebastián
0
投稿コメントは受け付けていません。
コメント
3件のコメント