I am trying to get Cplex working with pyomo. I have followed Cplex installation instructions has explained here: Downloading and setting up CPLEX for Pyomo

However when calling Cplex via pyomo I get the following:

File "...\pyomo\opt\base\solvers.py", line 607, in solve
    result = self._postsolve()
  File "...\pyomo\solvers\plugins\solvers\CPLEX.py", line 906, in _postsolve
    results = ILMLicensedSystemCallSolver._postsolve(self)
  File "...\pyomo\opt\solver\shellcmd.py", line 251, in _postsolve
OSError: [Errno 22] Invalid argument: '"C:\\Users\\...\\AppData\\Local\\Temp\\tmppc5loeps.cplex.log"'

I have verified that C:\Program Files\IBM\ILOG\CPLEX_Studio_Community201\cplex\bin\x64_win64 is in the Path variable

  • $\begingroup$ You could find the useful answers for your question by searching on community. For example this and this one. Do you try that? $\endgroup$
    – A.Omidi
    Feb 4, 2022 at 8:49
  • $\begingroup$ Thanks for your comment. The first link is not relevant. As for the second I have verified that Cplex is in the path variable $\endgroup$
    – Meth
    Feb 4, 2022 at 9:40
  • $\begingroup$ A bit unlikely on Windows but it could be a permissions issue, are you certain that your program has write access to that directory? You can try running in administrator mode just to make sure. $\endgroup$ Feb 4, 2022 at 11:25
  • $\begingroup$ Running VSCode as an admin produces the same error $\endgroup$
    – Meth
    Feb 4, 2022 at 11:54


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.