rl-institut / multi-vector-simulator

Multi-vector Simulation Tool assessing and optimizing Local Energy Systems (LES) for the E-LAND project
GNU General Public License v2.0
21 stars 10 forks source link

[Bug] `pip install multi-vector-simulator[report]` does not work on windows #645

Open smartie2076 opened 3 years ago

smartie2076 commented 3 years ago

The above instruction pip install multi-vector-simulator[report] can not install everything on windows that is required for the report. This connects to the necessity to have a .yml file (#476).

Otherwise this is the error message:

Traceback (most recent call last):
  File "D:\PycharmProjects\mvs_eland\winenv\lib\site-packages\graphviz\backend.py", line 164, in run
    proc = subprocess.Popen(cmd, startupinfo=get_startupinfo(), **kwargs)
  File "D:\PycharmProjects\mvs_eland\winenv\lib\subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "D:\PycharmProjects\mvs_eland\winenv\lib\subprocess.py", line 1017, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "mvs_tool.py", line 4, in <module>
    main()
  File "D:\PycharmProjects\mvs_eland\winenv\lib\site-packages\multi_vector_simulator\cli.py", line 159, in main
    dict_values, save_energy_system_graph=save_energy_system_graph
  File "D:\PycharmProjects\mvs_eland\winenv\lib\site-packages\multi_vector_simulator\D0_modelling_and_optimization.py", line 89, in run_oemof
    dict_values, model, save_energy_system_graph=save_energy_system_graph
  File "D:\PycharmProjects\mvs_eland\winenv\lib\site-packages\multi_vector_simulator\D0_modelling_and_optimization.py", line 239, in plot_networkx_graph
    graph.render()
  File "D:\PycharmProjects\mvs_eland\winenv\lib\site-packages\multi_vector_simulator\F1_plotting.py", line 379, in render
    self.dot.render(**kwargs)
  File "D:\PycharmProjects\mvs_eland\winenv\lib\site-packages\graphviz\files.py", line 209, in render
    quiet=quiet)
  File "D:\PycharmProjects\mvs_eland\winenv\lib\site-packages\graphviz\backend.py", line 221, in render
    run(cmd, capture_output=True, cwd=cwd, check=True, quiet=quiet)
  File "D:\PycharmProjects\mvs_eland\winenv\lib\site-packages\graphviz\backend.py", line 167, in run
    raise ExecutableNotFound(cmd)
graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpng', '-O', 'energy_system_graph'], make sure the Graphviz executables are on your systems' PATH

The troubleshooting helps to fix with: conda install -c alubbock graphviz pygraphviz and dot -c.

Bachibouzouk commented 3 years ago

The problem is the lack of pygraphviz for windows, I am not sure we can do something against that ?

smartie2076 commented 3 years ago

I wanted to emphasize that we may still need a yml file, and that the troubleshooting for this is still important. When creating the yml file, this is also solved

Bachibouzouk commented 3 years ago

Solution 1: create a mvs package on conda

Solution 2: run a script on pip install when detecting window to download pygraphviz from conda

smartie2076 commented 3 years ago

For (2) we might want to check out this approach: https://stackoverflow.com/questions/17806485/execute-a-python-script-post-install-using-distutils-setuptools