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

Update graphviz install instructions #205

Merged
merged 4 commits into from
Nov 3, 2023
Merged

Conversation

trevorb1
Copy link
Member

Description

In this PR I have updated the documentation site with instructions on what to do if you run into a graphviz dependency error. Specifially, this warning has been added to the RES example.

image

Issue Ticket Number

Closes #204

Documentation

Added to examples.rst

@trevorb1
Copy link
Member Author

Actually, thinking about this again, it may just be simpler to add graphviz to the requirements. I guess my only hesitancy to this is that (based on Stack Overflow threads), Windows users can sometimes run into issues with it not being installed correctly through this method.

I have added graphviz to the package dependencies and will try installing everything on a fresh copy of Windows soon. If everything works, I will remove the warning message in the docs.

@trevorb1
Copy link
Member Author

trevorb1 commented Nov 3, 2023

This is a little odd. Graphviz gets installed, yet the dot command is still not recognized.

(otoole-test) C:\Users\trevo\Documents\repos\otoole>pip show graphviz
Name: graphviz
Version: 0.20.1
Summary: Simple Python interface for Graphviz
Home-page: https://github.com/xflr6/graphviz
Author: Sebastian Bank
Author-email: [email protected]
License: MIT
Location: C:\Users\trevo\miniconda3\envs\otoole-test\Lib\site-packages
Requires: 
Required-by: otoole

(otoole-test) C:\Users\trevo\Documents\repos\otoole>dot -V                
'dot' is not recognized as an internal or external command,
operable program or batch file.

@trevorb1
Copy link
Member Author

trevorb1 commented Nov 3, 2023

Okay, so it seems you have to install it on the system, but don't actually need the dependency in the venv.

(otoole-test) C:\Users\trevo\Documents\repos\simplicity>dot -V
dot - graphviz version 9.0.0 (20230911.1827)

(otoole-test) C:\Users\trevo\Documents\repos\simplicity>pip show graphviz
WARNING: Package(s) not found: graphviz

(otoole-test) C:\Users\trevo\Documents\repos\simplicity>otoole viz res csv data res.png config.yaml

# writes out res.png correctly

@trevorb1
Copy link
Member Author

trevorb1 commented Nov 3, 2023

Okay. So my solution was to remove my proposed solution of adding graphviz to otoole's requirements, and instead provide instructions to the user on how to install graphviz to their system. This seems to be the generally accepted solution (see here).

@trevorb1 trevorb1 merged commit 5331c5d into OSeMOSYS:master Nov 3, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Generation of RES on Windows
1 participant