File src/gurobipy/gurobi.pxi:3647, in gurobipy.read() File src/gurobipy/gurobi.pxi:70, in gurobipy.gurobi.read() AttributeError: 'PosixPath' object has no attribute 'find'
AnsweredHi,
I meet this error when the program call grb.read() inside a pytorch.geometric dataloader. I am running gurobi 10.0.3 with the server license install on hpc. I try to use the same environment and just read the gurobi file the program is trying to read and it works. I am not sure what is the problem.


0
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Junyang Cai,
The Path.glob function is returning a generator expression of PosixPath objects, and then you are passing one of these to gurobipy.read, which causes an error because this function only accepts strings.
The easiest fix is to modify the line with the read function to:
model = grb.read(str(mip_file))
so that the PosixPath is converted to a string representation.
- Riley
0
Post is closed for comments.
Comments
2 comments