Skip to content
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

LpProblem.fromMPS() function does not work on UNIX system? #705

Open
3 of 12 tasks
tle4336 opened this issue Nov 22, 2023 · 1 comment
Open
3 of 12 tasks

LpProblem.fromMPS() function does not work on UNIX system? #705

tle4336 opened this issue Nov 22, 2023 · 1 comment

Comments

@tle4336
Copy link

tle4336 commented Nov 22, 2023

Details for the issue

What did you do?

I currently need to read a .mps file back into Pycharm using LpProblem.fromMPS([file directory], sense=Lp.Maximize). However, when doing things on UNIX system in a Docker container (Jenkins), I kept bumping into the weird error:

15:36:40 File "/-python/.local/lib/python3.10/site-packages/pulp/pulp.py", line 1541, in fromMPS
15:36:40 data = mpslp.readMPS(filename, sense=sense, **kwargs)
15:36:40 File "/
-python/.local/lib/python3.10/site-packages/pulp/mps_lp.py", line 91, in readMPS
15:36:40 row_name = line[1]
15:36:40 IndexError: list index out of range

What did you expect to see?

I expect the file to be read successfully, as I was able to do so locally on a Windows 10 system.

What did you see instead?

Error message:

15:36:40 File "/-python/.local/lib/python3.10/site-packages/pulp/pulp.py", line 1541, in fromMPS
15:36:40 data = mpslp.readMPS(filename, sense=sense, **kwargs)
15:36:40 File "/
-python/.local/lib/python3.10/site-packages/pulp/mps_lp.py", line 91, in readMPS
15:36:40 row_name = line[1]
15:36:40 IndexError: list index out of range

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: UNIX

I'm using python version:

  • 2.7
  • 3.4
  • 3.5
  • 3.6
  • [X ] Other: 3.10

I installed PuLP via:

Did you also

@pchtsp
Copy link
Collaborator

pchtsp commented Jan 15, 2024

you're giving a list of files as argument, from what I get from your example. The package is constantly tested in Linux.

You should do:

LpProblem.fromMPS(file directory, sense=Lp.Maximize)

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