OSeMOSYS / osemosys_global

A global power system model generator for OSeMOSYS
https://osemosys-global.readthedocs.io/
GNU Affero General Public License v3.0
27 stars 17 forks source link

[BUG] Unable to run the Snakemake -j6 example after installation from the env file (Ubuntu) #180

Closed ajipratama14 closed 5 months ago

ajipratama14 commented 5 months ago

Conda environment check

Current Behavior

Hi I want to use the OSeMOSYS global for modelling energy systems in Indonesia. However, I encounter some problems. It seems that the snakemake example couldn't be run on my laptop. Do you know why this issue happened? Attached are the snapshot of the errors and also the logdetail. Thanks! timeslice.log demand_projections.log powerplant.log

error 3 error 2 error1

Expected Behavior

No response

Steps To Reproduce

  1. Running this OSeMOSYS in Ubuntu
  2. Already installed all the glpk and solvers (CBC, CPLEX).
  3. The log detail says "ModuleNotFoundError: No module named 'osemosys_global'"

Operating System

Linux

Log output

Traceback (most recent call last):
  File "C:\Users\sap123\osemosys_global\workflow\scripts\osemosys_global\powerplant_data.py", line 20, in <module>
    from utils import apply_dtypes
  File "C:\Users\sap123\osemosys_global\workflow\scripts\osemosys_global\utils.py", line 6, in <module>
    from osemosys_global.constants import SET_DTYPES
ModuleNotFoundError: No module named 'osemosys_global'

Traceback (most recent call last):
  File "C:\Users\sap123\osemosys_global\workflow\scripts\osemosys_global\demand_projection.py", line 7, in <module>
    import world_bank_data as wb
ModuleNotFoundError: No module named 'world_bank_data'

Traceback (most recent call last):
  File "C:\Users\sap123\osemosys_global\workflow\scripts\osemosys_global\TS_data.py", line 19, in <module>
    from osemosys_global.utils import apply_timeshift
ModuleNotFoundError: No module named 'osemosys_global'

Anything else?

No response

trevorb1 commented 5 months ago

Hi @ajipratama14; thanks for submitting the issue!

I have just merged in a PR that should fix some package issues we ran into a couple weeks ago; including the ModuleNotFoundError: No module named 'osemosys_global' error. Are you able to try and pull the latest fix (from the master branch) and try the install again and let me know if that fixes the issue. I dont recall seeing the ModuleNotFoundError: No module named 'world_bank_data' error on my side before, but maybe the latest PR will address that to.

Apologies for the install issues, and thank you for reporting!

ajipratama14 commented 5 months ago

Hi @trevorb1 ,

Thanks for the answer! For the ModuleNotFoundError: No module named 'world_bank_data' is already solved on my side. But, the ModuleNotFoundError: No module named 'osemosys_global' is still happening. I already tried to pull the new PR, but seems the problem still exists. Please see the attached log. demand_projections.log powerplant.log timeslice.log

maartenbrinkerink commented 5 months ago

Hi @ajipratama14. Could you try removing osemosys-global from your env file and reinstall with pip install git+https://github.com/OSeMOSYS/osemosys_global@master and try again?

trevorb1 commented 5 months ago

Or, to add to @maartenbrinkerink's answer, can you try just doing pip install . from the root directory

ajipratama14 commented 5 months ago

Hi @trevorb1 @maartenbrinkerink, it works! thank you so much for your help.

maartenbrinkerink commented 5 months ago

@ajipratama14 You're welcome! @trevorb1 Unfortunately that does seem to imply that our installation issues for Ubuntu based on the env file are not fully fixed :( I suggest to keep this issue open for the time being. Also in case someone else runs into similar issues.

trevorb1 commented 5 months ago

@maartenbrinkerink; I updated install instructions to use mamba (following @abhishek0208's suggestion) and everything worked fine now. I tested on a fresh install of Ubuntu and I did not need the additional gcc install steps. If you run into any more install issues, please feel free to reopen though!