メインコンテンツへスキップ

Error in Reading Model: Python Jupyter

回答済み

コメント

8件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi,

    Could you please provide more information? In particular, could you show the code you are using to read the \(\texttt{afiro}\) model? Are you sure that you are in the correct folder? Could you try to provide the full path to the \(\texttt{afiro}\) model? On a Mac, this would be

    /Library/gurobi912/mac64/examples/data/afiro.mps

    Best regards,
    Jaromił

    0
  • Syed Saad Ali
    • Gurobi-versary
    • Conversationalist
    • First Question

    I have entered this code to read the file, but its not working

    model = read("C:\gurobi912\win64\examples\data\afiro.mps")

    0
  • Jaromił Najman
    • Gurobi Staff

    Could you please post your whole code snippet? Can you please double check that the path is correct and the file \(\texttt{afiro.mps}\) is indeed in the desired location?

    From the command line, can you execute

    gurobi_cl C:\gurobi912\win64\examples\data\afiro.mps

    Are you using the \(\texttt{gurobi.bat}\) shell?

    Are you able to execute the following Python code?

    import gurobipy as gp

    model = gp.Model("test")
    0
  • Syed Saad Ali
    • Gurobi-versary
    • Conversationalist
    • First Question

    0
  • Syed Saad Ali
    • Gurobi-versary
    • Conversationalist
    • First Question

    and yes, I am also able to execute the code from the command line as you asked in the above comment 

    gurobi_cl C:\gurobi912\win64\examples\data\afiro.mps
    0
  • Jaromił Najman
    • Gurobi Staff

    \(\texttt{\a}\) is the escape sequence for the ASCII bell. In your code you should use \(\texttt{\\\\}\) instead of \(\texttt{\\}\) when specifying paths.

    model = read("C:\\gurobi912\\win64\\examples\\data\\afiro.mps")

    Best regards,
    Jaromił

    1
  • Syed Saad Ali
    • Gurobi-versary
    • Conversationalist
    • First Question

    Yeah, that was the problem. Now it works. 

    Thanks a lot for your quick responses, Jaromil :)

    0

投稿コメントは受け付けていません。