HiGHS Log File Not Found/Created
Details for the issue
What did you do?
Modeled a MILP problem with PuLP and attempted to solve with the HiGHS_CMD solver. Defined a basic problem and solver as follows:
import pulp as pl
prob = pl.LpProblem("Name", pl.LpMaximize)
solver = pl.HiGHS_CMD()
...
result = prob.solve(solver)
print(result)
What did you expect to see?
I expected to see the result assigned to result and printed to the command line.
What did you see instead?
I get a FileNotFoundError with the following message:
[Errno 2] No such file or directory: '/var/folders/qc/sgm9_xyx4t7c_t01c_1klnkc0000gn/T/df3e5a7bf9d04d15b4bba49ee31da6f5-pulp.HiGHS_log'
I checked the directory and found the equivalent .mps and .HiGHS files, but the HiGHS_log file was not created.
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: ___ )
- [x] Mac OS: ( version: 14.2.1)
- [ ] Other: ___
I'm using python version:
- [ ] 3.7
- [ ] 3.8
- [ ] 3.9
- [ ] 3.10
- [ ] 3.11
- [x] Other: 3.12
I installed PuLP via:
- [x] pypi (python -m pip install pulp)
- [ ] github (python -m pip install -U git+https://github.com/coin-or/pulp)
- [ ] Other: ___ (conda?)
Did you also
- [ ] Tried out the latest github version: https://github.com/coin-or/pulp
- [x] Searched for an existing similar issue: https://github.com/coin-or/pulp/issues?utf8=%E2%9C%93&q=is%3Aissue%20**
I'm facing the exact same issue apart from using Windows. Have you found a solution for this problem in the meantime?
Thanks for reporting. Unfortunately, I cannot reproduce this error as we do not have HiGHS_CMD in the CI.
Is there any instructions to download and install highs? Extra points if it's cross-platform and does not require user interaction.
@pchtsp for the command line version, you can download a pre-compiled binary or build it from source with CMake:
https://ergo-code.github.io/HiGHS/dev/installation/
Hi! I had the same problem in Linux (Ubuntu) and to me it was solved by running
sudo ldconfig
in the terminal after installing HiGHS.
I don't know for other OS, but maybe this can help someone else with the same issue on Linux
Hello !
I faced the same problem. The issue seems to come from a bad linking of the HiGHS libraries. I compiled using the advice at THIS LINK using the flag -DBUILD_SHARED_LIBS=OFF and now the error is gone. This is equivalent to what @DavideTr8 suggested but in my case ldconfig was not updating the links. However, it would be great if Pulp could check highs is called since there is an error reported by highs if called manually highs: error while loading shared libraries: libhighs.so.1: cannot open shared object file: No such file or directory
I am running HiGHS and Pulp on python3.12 official debian docker image.
@pchtsp if you want to add HiGHS checks to the CI, I am using this Dockerfile to build the base image for the runners on my application:
FROM python:3.12-bookworm AS base
RUN set -ex; \
apt-get update; \
apt-get install -y git g++ gcc curl cmake; \
git clone https://github.com/ERGO-Code/HiGHS.git
FROM base AS compiler
RUN set -ex; \
cd HiGHS; \
mkdir build; \
cmake -DBUILD_SHARED_LIBS=OFF -B build; \
cmake --build build; \
cd build; \
make; \
make install
FROM base AS runtime
COPY --from=compiler /usr/local/bin /usr/local/bin
ENTRYPOINT [""]