Skip to main content

ERROR: LoadError: UndefVarError: `Gurobi` not defined

Answered

Comments

11 comments

  • Jia Yi Kung
    • Gurobi-versary
    • Conversationalist
    • First Question

    > Attachment 1

    > Attachment 2

    0
  • Riley Clement
    • Gurobi Staff

    Hi,

    Are you able to follow the steps and successfully run an example that are listed on the GenX README?

    - Riley

    0
  • Jia Yi Kung
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Riley, 

    Thank you so much for your prompt response! Yes I am. I followed the steps listed on the GenX readme step by step and also successfully run all cases in the example_systems folder, although I'm not sure whether all cases in the example_systems folder used Gurobi optimization tool or not.

    0
  • Riley Clement
    • Gurobi Staff

    Hi,

    We've noted that there are the following lines in GenX.jl which may be relevant:

    # Uncomment if Gurobi or CPLEX active license and installations are there and the user intends to use either of them
    #using CPLEX
    #using Gurobi


    Based on your screenshots I believe you will need to modify:

    /Users/doriskong/Desktop/GenX-main/src/GenX.jl

    After uncommenting the line for Gurobi, can you try again in a fresh instance of the Julia REPL and see if this resolves your issue?

    - Riley

     

     

    0
  • Jia Yi Kung
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Riley, 

    I really appreciate your help! I have uncomment the Gurobi, and this time the errors turn out to be 

    ERROR: LoadError: IOError: readdir("/Users/doriskong/Desktop/GenX-main/../../2030/100CFE_2030_SoCal_1000_4kg/Inputs"): no such file or directory (ENOENT)

    But I have checked the path is right and there're indeed have "Inputs" files...

    If I run the 

    include("2030_MoreZones/100CFE_2030_SoCal_1000_4kg/Run_247.jl"), then the error will turn out to be 

    ERROR: LoadError: SystemError: opening file "/Users/doriskong/Desktop/GenX-main/Settings/genx_settings.yml/gurobi_settings.yml": Not a directory

    I'm not sure whether it's because I have cloned the "Settings" folder in the GenX-main folder. If I didn't cloned the "Settings" folder , the terminal will keep showing this error:

    ERROR: LoadError: SystemError: opening file "/Users/doriskong/Desktop/GenX-main/Settings/genx_settings.yml": No such file or directory

    Below are the screenshots after I uncomment the Gurobi and comment out the other Solvers.

     

    The related codes in the  "2030_MoreZones" folder can be accessed here: https://zenodo.org/records/7442511

    As a note, I just used the raw files I accessed from the above website and haven't done any adjustments.

    Thanks again for your time and effort!!!

    0
  • Riley Clement
    • Gurobi Staff

    Hi Jia Yi Kung,

    This has ventured into not being an Gurobi-related issue so I can only provide some brief suggestions.  This is now either a GenX issue or an issue with the code published by the authors of the paper.  My guess is the latter, the use of relative paths doesn't seem robust and they provide little documentation.  However my recommendations are:

    * Remove the Settings folder in your GenX-main
    * In the Julia REPL change directory to the one containing Run_247.jl and try running

    include("Run_247.jl")

    from within that directory.

    - Riley

     

    0
  • Jia Yi Kung
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Riley, 

    Thanks and appreciate for your time and effort on this matter! Following your recommendations, I have removed the Settings folder in my GenX-main and changed directory in the Julia REPL. At this point, I also Replaced

    `julia --project="/tigress/wricks/GenX_CFE" Run_247.jl` 

    with

    `julia --project="." Run_247.jl` 

    in the Run_247.sh file (/Users/doriskong/Desktop/GenX-main/2030_MoreZones/100CFE_2030_SoCal_1000_4kg/Run_247.sh).

    At this point, I continue to receive this error despite I import lots of packages it asked for:

    "ERROR: LoadError: Failed to precompile GenX [top-level] to "/Users/doriskong/.julia/compiled/v1.9/
    jl_MYzAxq

    I understand that this might not be an Gurobi-related issue anymore but will open to any suggestions and advice. Thanks again for your guidance along the way! :)

    0
  • Riley Clement
    • Gurobi Staff

    Hi,

    My only advice is to follow the instructions suggested in the error:

    Run 'Pkg.instantiate()' to install all recorded dependencies

    - Riley

    0
  • rachael seidel
    • Gurobi-versary
    • First Comment

    Hi Jia Yi Kung,

    I am having the same problem when trying to use Gurobi with GenX. Did you ever figure this out?

    -Ivy

    0
  • Jia Yi Kung
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Rachael, 

    I have figured it out but I'm not sure whether you used the same dataset as I have. My problem was solved after the authors updated the version of their dataset, which includes the 24/7 matching constraints.

    Also, the dataset I used here requires more RAM to run than a single desktop can provide, so I ended up using only a single region for my study. Hope this helps! 
     
    Best, 
    Doris
     
     

     

    0
  • rachael seidel
    • Gurobi-versary
    • First Comment

    Thanks for responding, I doubt we are using the same data sets but I was assuming it was some sort of Path issue that I cant figure out since the Error message seems to be that GenX can't find a reference to Gurobi.

    I'm not entirely sure what you mean by 24/7 matching constraints, the time domain reduction? At this stage I'm just trying to get an example system to run.

    Thanks,

    Rachael

    0

Please sign in to leave a comment.