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

Add pygraphviz docs for Windows #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,39 @@ pip3 install numpy pydot networkx progressbar2 pygraphviz pymdptoolbox
pip3 install -r requirements.txt
```

### pyraphiz failing to install?
### pygraphviz failing to install?
`pygraphviz` requires you to have the graphviz package installed on your OS.
See this [thread](https://github.com/rldm/hw3-tester/issues/2)


3. Docker:
### Installing `pygraphviz` on Windows

*instructions inspired and adapted from [here](https://stackoverflow.com/questions/40809758/howto-install-pygraphviz-on-windows-10-64bit) and [here](https://stackoverflow.com/questions/45093811/installing-pygraphviz-on-windows-10-64-bit-python-3-6/54890705#54890705)*

* Download `graphviz-2.38.msi` (a dependency of `pygraphviz`) from here:
* https://graphviz.gitlab.io/_pages/Download/Download_windows.html
* Install it manually
* Add `graphviz` tot PATH; specifically, add `C:\Program Files (x86)\Graphviz2.38\bin`
* from the Windows menu (Windows logo key), search for: "*Environment Variables*" (the entry should be called "*Edit the system environment variables*")
* click on Environment Variables
* under `User variables for <username>`, find `Path` and double click on it
* click `New`
* add `C:\Program Files (x86)\Graphviz2.38\bin` and click `OK`
* **restart the Anaconda window and other command prompt windows that are open**
* *there is an easier way of doing this, through `SETX`, but it is dangerous as it can erase your entire `PATH` variable if you make some typos*
* Download the `pygraphviz` wheel from here:
* **Python 3.5/3.6/3.7**
* https://github.com/CristiFati/Prebuilt-Binaries/tree/master/Windows/PyGraphviz
* **Python 2.7**
* https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygraphviz
* Navigate to the directory where the downloaded wheel file is located
* Run `pip install your_downloaded_pygraphviz_file.whl`
* Example for **Python 3.5 on Windows 10 amd64**: `pip install pygraphviz-1.5-cp35-cp35m-win_amd64.whl`
* Now you should have `pygraphviz` successfully installed. Test it properly by running the tester script with the `-s` flag.
* `python hw3_tester.py -m sample.json -i -vvv -s`

Another possible solution has been offered [here](https://stackoverflow.com/questions/45093811/installing-pygraphviz-on-windows-10-64-bit-python-3-6/53137438#53137438) but I have not tested it.

1. Docker:

```bash
docker build -t rldm/hw3-tester:v1 .
Expand Down Expand Up @@ -69,7 +96,7 @@ python hw3_tester.py -m sample.json -i -vvv
Output will show:

```
06/12/2017 01:57:32 AM - INFO:
06/12/2017 01:57:32 AM - INFO:
06/12/2017 01:57:32 AM - INFO: mdp returned median number of iterations 2
number of iterations: 2
06/12/2017 01:57:32 AM - INFO: end of script
Expand Down