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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With