2
$\begingroup$

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
    OUTPUT=open(self._log_file,"w")
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

$\endgroup$
4
  • $\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
    Commented 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
    Commented 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$ Commented Feb 4, 2022 at 11:25
  • $\begingroup$ Running VSCode as an admin produces the same error $\endgroup$
    – Meth
    Commented Feb 4, 2022 at 11:54

0

Browse other questions tagged or ask your own question.