8000 Solver fails if TMPDIR includes a space · Issue #811 · coin-or/pulp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Solver fails if TMPDIR includes a space #811

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

Open
3 of 15 tasks
saizai opened this issue Mar 15, 2025 · 2 comments
Open
3 of 15 tasks

Solver fails if TMPDIR includes a space #811

saizai opened this issue Mar 15, 2025 · 2 comments

Comments

@saizai
Copy link
saizai commented Mar 15, 2025

Details for the issue

What did you do?

Run pulp with environment TMP="/Volumes/RAM Disk/"

What did you expect to see?

Results

What did you see instead?

Usage: gurobi_cl [--command]* [param=value]* filename
Type 'gurobi_cl --help' for more information.
Traceback (most recent call last):
  [redacted]
  File [redacted]
    problem.solve(pulp.GUROBI_CMD(threads=16, timeLimit=600))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[redacted]/Python/3.13/lib/python/site-packages/pulp/pulp.py", line 1996, in solve
    status = solver.actualSolve(self, **kwargs)
  File "[redacted]/Python/3.13/lib/python/site-packages/pulp/apis/gurobi_api.py", line 494, in actualSolve
    lp.assignVarsVals(values)
    ~~~~~~~~~~~~~~~~~^^^^^^^^
  File "[redacted]/Python/3.13/lib/python/site-packages/pulp/pulp.py", line 1918, in assignVarsVals
    for name in values:
                ^^^^^^
TypeError: 'NoneType' object is not iterable

Fix

Run pulp with environment TMP="/Volumes/RAMDisk/" (no space)

See e.g.

cmd += f" ResultFile={tmpSol}"
if self.optionsDict.get("warmStart", False):
self.writesol(filename=tmpMst, vs=vs)
cmd += f" InputFile={tmpMst}"
if lp.isMIP():
if not self.mip:
warnings.warn("GUROBI_CMD does not allow a problem to be relaxed")
cmd += f" {tmpLp}"
which fail to quote the file names. Probably true for other APIs too.

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • Windows: ( version: ___ )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using python version:

  • 3.7
  • 3.8
  • 3.9
  • 3.10
  • 3.11
  • Other: 3.13.2

I installed PuLP via:

Did you also

@pchtsp
Copy link
Collaborator
pchtsp commented Mar 17, 2025

Is there anything we can do from the pulp side? such as escaping the paths or something? Let me know. Even better, submit a PR if you think you know how to fix it.

@saizai
Copy link
Author
saizai commented Mar 17, 2025

My Python skills aren't good enough to make the PR myself, but e.g. in the lines I cite, the file names/paths should be shell-escaped and shell-quoted before being added to options on the shell cmd

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
0