Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

issue in installing SPARQLWrapper in python

Tags:

python

rdf

sparql

I installed SPARQLWrapper in python in the installation it shows: Installed c:\python27\lib\site-packages\sparqlwrapper-1.4.2-py2.7.egg

egg file are available in sit-packages.

When I tried to import SPARQLWrapper , the program cannot it. I am new to python and have no clue what are these egg files and how to handle it.

could someone guide me how can i import SPARQL wrapper

like image 361
Shruts_me Avatar asked May 18 '26 09:05

Shruts_me


1 Answers

An egg folder or zip file needs to exist in your PYTHONPATH. Normally, eggs in site-packages should be automatically installed in the path.

Execute your python interpreter, eg:

python2.7
>>> import sys
>>> print sys.path

If you don't see c:\python27\lib\site-packages\sparqlwrapper-1.4.2-py2.7.egg in sys.path then either the egg wasn't really installed there, or it's not a valid egg. If it's there, I'd suggest you're trying to import the wrong module. Case matters.

You should be able to do:

>>> import SPARQLWrapper

or

>>> from SPARQLWrapper import Wrapper

If you're still having problems, please update your question with the actual error message you're getting

like image 130
Auspex Avatar answered May 21 '26 00:05

Auspex