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

ImportError: cannot import name Virtuoso #1

Open
wudapeng268 opened this issue Apr 5, 2017 · 4 comments
Open

ImportError: cannot import name Virtuoso #1

wudapeng268 opened this issue Apr 5, 2017 · 4 comments

Comments

@wudapeng268
Copy link

wudapeng268 commented Apr 5, 2017

Hi juanique:
I install this tool follow your README, but when I test
from vituoso import Virtuoso I got
INFO:rdflib:RDFLib Version: 5.0.0-dev Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name Virtuoso
Actually I don't know how to test python-virtuoso, maybe is the tests.py, when I input host=localhost, user=dba pwd=dba
`..EEEE
ERROR: test_execute_bad_script (main.CommandsTests)
Executing bad scripts should raise a ISQLWrapperException
Traceback (most recent call last):
File "tests.py", line 44, in test_execute_bad_script
"fixtures/bad_script.sql")
File "/usr/lib/python2.7/unittest/case.py", line 475, in assertRaises
callableObj(*args, **kwargs)
File "/home/zhaocq/python-virtuoso-master/virtuoso/isqlwrapper.py", line 23, in execute_script
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

ERROR: test_execute_cmd (main.CommandsTests)
It can execute a given command string.
Traceback (most recent call last):
File "tests.py", line 49, in test_execute_cmd
result = self.isql.execute_cmd("status();")
File "/home/zhaocq/python-virtuoso-master/virtuoso/isqlwrapper.py", line 39, in execute_cmd
result = self.execute_script(tf_query.name)
File "/home/zhaocq/python-virtuoso-master/virtuoso/isqlwrapper.py", line 23, in execute_script
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

ERROR: test_execute_script (main.CommandsTests)
It can execute a given script

Traceback (most recent call last):
File "tests.py", line 37, in test_execute_script
result = self.isql.execute_script("fixtures/status.sql")
File "/home/zhaocq/python-virtuoso-master/virtuoso/isqlwrapper.py", line 23, in execute_script
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

ERROR: test_semicolon (main.CommandsTests)
Final semicolon is optional

Traceback (most recent call last):
File "tests.py", line 55, in test_semicolon
result = self.isql.execute_cmd("status()")
File "/home/zhaocq/python-virtuoso-master/virtuoso/isqlwrapper.py", line 39, in execute_cmd
result = self.execute_script(tf_query.name)
File "/home/zhaocq/python-virtuoso-master/virtuoso/isqlwrapper.py", line 23, in execute_script
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Ran 6 tests in 0.010s

FAILED (errors=4)`
I also try to change default port as 1111 because my virtuoso starts at port 1111 default, It's also the same error.
Can you help me solve this problem?
I will appreciate it, thx.

@juanique
Copy link
Owner

juanique commented Apr 6, 2017

Hi wudapeng268,

I literally haven't touched or run this code in 5 years. At some point I know it worked but in retrospective it does look like a really ugly hack and I don't think I'd recommend it to anyone.

I would recommend you take a look at other, supported libraries for connecting to virtuoso.

Perhaps any of the suggestions here? http://stackoverflow.com/questions/40774932/how-to-access-virtuoso-rdf-store-from-python

@wudapeng268
Copy link
Author

Hi juanique:
Thanks for your reply. Actually I have read this suggestions, but can't solve it. I will look it again。

@zhimeng9
Copy link

from vituoso.vituoso import Virtuoso

@zhimeng9
Copy link

but when I try to do the query, the error throw: "TypeError: 'Endpoint' object is not callable"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants