Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with the tutorial on Windows (error in rule solve_network) #1199

Open
matteodefelice opened this issue Nov 17, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@matteodefelice
Copy link

I am using the latest version of Pypsa-earth installing the environment using mamba.

Describe the Bug

When trying to solve the network I get the following error message:

INFO:pypsa.linopt:Solver command: "highs --model_file C:\Users\matte\AppData\Local\Temp\pypsa-problem-_n8dfe_z.lp --solver ipm --options_file highs_options.txt"
ERROR:_helpers:An error happened in module 'C:\\Users\\matte\\miniconda3\\envs\\pypsa-earth\\lib\\site-packages\\pandas\\core\\indexes\\base.py', function 'get_loc': 'Model   status'
Traceback (most recent call last):
  File "C:\Users\matte\miniconda3\envs\pypsa-earth\lib\site-packages\pandas\core\indexes\base.py", line 3805, in get_loc
    return self._engine.get_loc(casted_key)
  File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc
  File "index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\\_libs\\hashtable_class_helper.pxi", line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\\_libs\\hashtable_class_helper.pxi", line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Model   status'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\matte\local_work\pypsa-earth\.snakemake\shadow\tmpqeuraqht\.snakemake\scripts\tmpao288_9f.solve_network.py", line 1025, in <module>
    n = solve_network(
  File "C:\Users\matte\local_work\pypsa-earth\.snakemake\shadow\tmpqeuraqht\.snakemake\scripts\tmpao288_9f.solve_network.py", line 950, in solve_network
    network_lopf(
  File "C:\Users\matte\miniconda3\envs\pypsa-earth\lib\site-packages\pypsa\linopf.py", line 1576, in network_lopf
    res = solve(
  File "C:\Users\matte\miniconda3\envs\pypsa-earth\lib\site-packages\pypsa\linopt.py", line 781, in run_and_read_highs
    model_status = log["Model   status"].strip().lower()
  File "C:\Users\matte\miniconda3\envs\pypsa-earth\lib\site-packages\pandas\core\series.py", line 1121, in __getitem__
    return self._get_value(key)
  File "C:\Users\matte\miniconda3\envs\pypsa-earth\lib\site-packages\pandas\core\series.py", line 1237, in _get_value
    loc = self.index.get_loc(label)
  File "C:\Users\matte\miniconda3\envs\pypsa-earth\lib\site-packages\pandas\core\indexes\base.py", line 3812, in get_loc
    raise KeyError(key) from err
KeyError: 'Model   status'
[Sun Nov 17 21:39:02 2024]
Error in rule solve_network:
    jobid: 1
    input: networks/elec_s_6_ec_lcopt_Co2L-4H.nc
    output: results/networks/elec_s_6_ec_lcopt_Co2L-4H.nc
    log: logs\solve_network\elec_s_6_ec_lcopt_Co2L-4H_solver.log, logs/solve_network/elec_s_6_ec_lcopt_Co2L-4H_python.log (check log file(s) for error details)

RuleException:
CalledProcessError in file C:\Users\matte\local_work\pypsa-earth\Snakefile, line 845:
Command 'C:/Users/matte/miniconda3/envs/pypsa-earth/python.exe "C:\Users\matte\local_work\pypsa-earth\.snakemake\shadow\tmpqeuraqht\.snakemake\scripts\tmpao288_9f.solve_network.py"' returned non-zero exit status 1.
  File "C:\Users\matte\local_work\pypsa-earth\Snakefile", line 845, in __rule_solve_network
  File "C:\Users\matte\miniconda3\envs\pypsa-earth\lib\concurrent\futures\thread.py", line 58, in run

Normally, I can use my windows machine for PyPSA, is Windows supported?

@matteodefelice matteodefelice added the bug Something isn't working label Nov 17, 2024
@ekatef
Copy link
Member

ekatef commented Nov 18, 2024

Hello @matteodefelice, thanks a lot for reporting!

Do I understand properly that you using HiGHS? At the moment, HiGHS is not yet supported by the upstream, but there is a feature branch which allows to do so for power-only formulation, and a PR #1182 to use the full cross-sectoral model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants