Skip to content

Commit b3e1f45

Browse files
coroametab0t
authored andcommitted
feat: find gurobi in pixi environment
1 parent f48d68c commit b3e1f45

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pyoptinterface/_src/gurobi.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import platform
33
from pathlib import Path
44
import re
5+
import sys
56
import logging
67
from typing import Tuple, Union, overload
78

@@ -81,6 +82,14 @@ def detected_libraries():
8182
except Exception:
8283
pass
8384

85+
# conda/pixi environment
86+
prefix = Path(sys.prefix)
87+
dir = prefix / subdir
88+
for path in dir.glob(suffix_pattern):
89+
match = re.match(libname_pattern, path.name)
90+
if match:
91+
libs.append(str(path))
92+
8493
# default names
8594
gurobi_names = [
8695
"gurobi130",

0 commit comments

Comments
 (0)