Skip to main content

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'

Answered

Comments

1 comment

  • Riley Clement
    • Gurobi Staff

    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

Please sign in to leave a comment.