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

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    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.
  • 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

Post is closed for comments.