lambdamusic / Ontospy

Python library and command-line interface for inspecting and visualizing RDF models aka ontologies.
http://lambdamusic.github.io/Ontospy/
MIT License
219 stars 52 forks source link

Install on Mac OSX #120

Open riannella opened 1 year ago

riannella commented 1 year ago

Hi, is it possible to install ontospy on Mac OSX?

I tried "sudo pip install ontospy -U --user python" but it returned "illegal hardware instruction sudo pip install ontospy -U --user pytho"

Thanks....

tobiasschweizer commented 1 year ago

I run it on macOS. Install instructions: pip3 install ontospy django pygments, see also https://lambdamusic.github.io/Ontospy/#generating-ontology-documentation.

riannella commented 1 year ago

Thanks...I tried that with these output:

renato@PurpleRain ~ % pip3 install ontospy django pygments
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: ontospy in ./Library/Python/3.9/lib/python/site-packages (1.9.9.4)
Requirement already satisfied: django in ./Library/Python/3.9/lib/python/site-packages (4.1.2)
Requirement already satisfied: pygments in ./Library/Python/3.9/lib/python/site-packages (2.13.0)
Requirement already satisfied: requests in ./Library/Python/3.9/lib/python/site-packages (from ontospy) (2.28.1)
Requirement already satisfied: click in ./Library/Python/3.9/lib/python/site-packages (from ontospy) (8.1.3)
Requirement already satisfied: rdflib in ./Library/Python/3.9/lib/python/site-packages (from ontospy) (6.2.0)
Requirement already satisfied: colorama in ./Library/Python/3.9/lib/python/site-packages (from ontospy) (0.4.6)
Requirement already satisfied: SPARQLWrapper in ./Library/Python/3.9/lib/python/site-packages (from ontospy) (2.0.0)
Requirement already satisfied: pyfiglet in ./Library/Python/3.9/lib/python/site-packages (from ontospy) (0.8.post1)
Requirement already satisfied: html5lib in ./Library/Python/3.9/lib/python/site-packages (from ontospy) (1.1)
Requirement already satisfied: pyparsing in ./Library/Python/3.9/lib/python/site-packages (from ontospy) (3.0.9)
Requirement already satisfied: sqlparse>=0.2.2 in ./Library/Python/3.9/lib/python/site-packages (from django) (0.4.3)
Requirement already satisfied: asgiref<4,>=3.5.2 in ./Library/Python/3.9/lib/python/site-packages (from django) (3.5.2)
Requirement already satisfied: six>=1.9 in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages (from html5lib->ontospy) (1.15.0)
Requirement already satisfied: webencodings in ./Library/Python/3.9/lib/python/site-packages (from html5lib->ontospy) (0.5.1)
Requirement already satisfied: isodate in ./Library/Python/3.9/lib/python/site-packages (from rdflib->ontospy) (0.6.1)
Requirement already satisfied: setuptools in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages (from rdflib->ontospy) (58.0.4)
Requirement already satisfied: charset-normalizer<3,>=2 in ./Library/Python/3.9/lib/python/site-packages (from requests->ontospy) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./Library/Python/3.9/lib/python/site-packages (from requests->ontospy) (1.26.12)
Requirement already satisfied: certifi>=2017.4.17 in ./Library/Python/3.9/lib/python/site-packages (from requests->ontospy) (2022.9.24)
Requirement already satisfied: idna<4,>=2.5 in ./Library/Python/3.9/lib/python/site-packages (from requests->ontospy) (3.4)
renato@PurpleRain ~ % which ontospy
ontospy not found
tobiasschweizer commented 1 year ago

I used a virtual env and it works. I would recommend doing the same, see https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments.

lambdamusic commented 1 year ago

Looks like a Python installation problem. This may help: pip/python: normal site-packages is not writeable

In general I try to avoid using the system-provided Python directly. See also https://opensource.com/article/19/5/python-3-default-mac

Once Python is set up correctly for your user, installing Ontospy only requires this command:

$ pip install ontospy -U

(-U at the end to force-update, in case you have an older installation)