简体   繁体   English

Python ibm pyomo cplex

[英]Python ibm pyomo cplex

I need some help with the activation of cplex community edition on linux in combination with python/pyomo.我需要一些帮助来结合 python/pyomo 在 linux 上激活 cplex 社区版。 I have followed the installation procedure on https://www.ibm.com/support/pages/node/297247我遵循了https://www.ibm.com/support/pages/node/297247上的安装过程

I have written the following two lines into my bash_profile我已将以下两行写入我的 bash_profile

export CPLEX_STUDIO_DIR1210=/path/to/cplex

export CPLEX_API_KEY=...

Then I have restarted my machine but I always get the message "Cplex Error 1016: Community Edition. Problem size limits exceeded."然后我重新启动了我的机器,但我总是收到消息“Cplex 错误 1016:社区版。超出问题大小限制”。

I also have tried to write the export lines into bashrc but without success.我也尝试将导出行写入 bashrc 但没有成功。

My relevant python code line looks like: Optimize = SolverFactory ('cplex', executable='/path/to/cplex-executable')我的相关 python 代码行如下所示:Optimize = SolverFactory ('cplex', executable='/path/to/cplex-executable')

I am looking forward to any hints.我期待着任何提示。 Thx谢谢

To unlock the model size limitations you need to set the CPLEX_STUDIO_KEY environment variable, not CPLEX_API_KEY .要解除模型大小限制,您需要设置CPLEX_STUDIO_KEY环境变量,而不是CPLEX_API_KEY If you fix that, hopefully your issue should go away.如果你解决了这个问题,希望你的问题会消失。

EDIT:编辑:

I didn't notice it the first time, but as far as I know, the CPLEX Community Edition is only available for 12.9 at this time.我第一次没有注意到,但据我所知,CPLEX Community Edition 目前仅适用于 12.9。 Please try setting the CPLEX_STUDIO_DIR129 environment variable instead of CPLEX_STUDIO_DIR1210 .请尝试设置CPLEX_STUDIO_DIR129环境变量而不是CPLEX_STUDIO_DIR1210 For example:例如:

export CPLEX_STUDIO_DIR129=/path/to/cplex

if you use the free community edition, the error如果您使用免费社区版,则错误

"Cplex Error 1016: Community Edition. Problem size limits exceeded." “Cplex 错误 1016:社区版。超出问题大小限制。”

is normal and means your model is bigger than what that free edition allows.是正常的,意味着您的模型大于免费版允许的模型。

So you could either:所以你可以:

  • Move to CPLEX academic initiative which is free for academics转向对学者免费的CPLEX 学术计划
  • Move to full CPLEX移动到完整的CPLEX
  • Call CPLEX in the IBM cloud as a service ( WML )在 IBM 云即服务 ( WML ) 中调用 CPLEX

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM