Minimuino / ASP-Graph

A tool for visual logic programming in ASP
GNU General Public License v3.0
1 stars 1 forks source link

GRASP for MacOS? #1

Open ofstrings2 opened 4 years ago

ofstrings2 commented 4 years ago

Hello — I am very interested in exploring your program GRASP. This seems to be the best software out there for allowing users to actively manipulate existential beta graphs. Is there a way for me to test it on a computer running Mac OS X? Thank you greatly in advance.

Minimuino commented 4 years ago

Hi @ofstrings2 ,

It's been a while since I stopped working on this project, so I will have to review the code before I can give you a proper answer. As far as I know the Kivy framework that I used for the GUI is cross-platform, so the only issues may come from clingo libraries. Let me review a bit and I'll get back to you in a couple of days.

Thanks for your interest in the project :)

Minimuino commented 4 years ago

I've just updated the repo with macOS support (tested on macOS 10.13.6). I've also added a doc/ folder where you can find further explanation of the theoretical background as well as implementation details. You must follow these steps in order to get the application running on macOS:

  1. Install kivy (install pip before if you don't have it already: https://ahmadawais.com/install-pip-macos-os-x-python/): python -m pip install kivy

  2. Install graphviz: brew install graphviz

  3. Install pygraphviz: python -m pip install pygraphviz --install-option="--include-path=/usr/local/include/graphviz/" --install-option="--library-path=/usr/local/lib/graphviz"

  4. Run the app with python: python src/main.py

  5. There's a nice in-app tutorial to learn how to use Grasp in a few minutes :) You can play it from the menu Help > Quick tutorial. Additionally, you can load some example graphs from the examples/ folder.

Let me know if you are able to get it running. Cheers!

ofstrings2 commented 4 years ago

Hi thanks for all this — I did the above, but now stuck @ "no module named 'clingo'" error. I also edited the code syntax to be compatible w/ python 3, but receiving a lot of kivy import errors, too. perhaps my directory structure is wrong? sorry for the newbie–type questions!

Minimuino commented 4 years ago

I did the above, but now stuck @ "no module named 'clingo'" error

That's weird: it means python is not even trying to load the files from lib/ folder. Did you download the whole repo or just the src/ folder? You need the whole directory structure as it is in the repo in order to run this with python. Also, could you please post the full python error trace, as well as your python version and macOS version? It may help to find the error.

I also edited the code syntax to be compatible w/ python 3, but receiving a lot of kivy import errors, too.

I think it's better to go one step at a time 😅 We should first get it working with python 2.7, then try porting to python 3.

ofstrings2 commented 4 years ago

Ok, when I try running it w/ python 2 I get this error:

Traceback (most recent call last): File "src/main.py", line 21, in <module> import tutorial File "~/GRASP/src/tutorial.py", line 20, in <module> from kivy.lang import Builder ImportError: No module named kivy.lang

Minimuino commented 4 years ago

If the installation command above succeeded, kivy should also be imported with no issues. Note that all the installation commands should also be run with python 2.7:

python -m pip install kivy
python -m pip install pygraphviz --install-option="--include-path=/usr/local/include/graphviz/" --install-option="--library-path=/usr/local/lib/graphviz"

If you ran them with python 3, you need to run them again using python 2.7. I'm sorry about this inconvenience, I know python 2.7 is deprecated but this was made years ago and now it would require some effort to port it to python 3.

So please verify your kivy installation is correct by entering python2.7 interpreter and typing import kivy. The output should be something like this:

$ python
Python 2.7.10 (default, Oct  6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import kivy
[INFO   ] [Logger      ] Record log in /Users/abc/.kivy/logs/kivy_20-06-28_1.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/Users/abc/Library/Python/2.7/lib/python/site-packages/kivy/__init__.pyc"
[INFO   ] [Python      ] v2.7.10 (default, Oct  6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python"
[WARNING] [Deprecated  ] Python 2 Kivy support has been deprecated. The Kivy release after 1.11.0 will not support Python 2 anymore
>>>