-
Notifications
You must be signed in to change notification settings - Fork 30
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
cannot import name 'convert_graph' from 'owlrl' #29
Comments
@ChrisGithubWork has indicated this is an issue with their installation, not a problem with OWL-RL or pySHACL. |
@ashleysommer Hi Ashley, I've been trying to deploy a flask app with gunicorn and it's giving me the same error. Any ideas why? Machine is Ubuntu 18.04, Python 3.6.7. It runs fine using the local flask server. (venv) ubuntu@vocab-corveg-dev2:/var/www/skos_viewer$ gunicorn --bind 127.0.0.1:5000 gunicorn_app:app
[2019-04-19 03:15:54 +0000] [23070] [INFO] Starting gunicorn 19.9.0
[2019-04-19 03:15:54 +0000] [23070] [INFO] Listening at: http://127.0.0.1:5000 (23070)
[2019-04-19 03:15:54 +0000] [23070] [INFO] Using worker: sync
[2019-04-19 03:15:54 +0000] [23073] [INFO] Booting worker with pid: 23073
[2019-04-19 03:15:54 +0000] [23073] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/var/www/skos_viewer/venv/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/var/www/skos_viewer/venv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
self.load_wsgi()
File "/var/www/skos_viewer/venv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
self.wsgi = self.app.wsgi()
File "/var/www/skos_viewer/venv/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/var/www/skos_viewer/venv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
return self.load_wsgiapp()
File "/var/www/skos_viewer/venv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
return util.import_app(self.app_uri)
File "/var/www/skos_viewer/venv/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
__import__(module)
File "/var/www/skos_viewer/gunicorn_app.py", line 1, in <module>
from app import app
File "/var/www/skos_viewer/app.py", line 4, in <module>
from owlrl import DeductiveClosure, OWLRL_Semantics
File "/var/www/skos_viewer/venv/bin/owlrl.py", line 4, in <module>
from owlrl import convert_graph, RDFXML, TURTLE, JSON, AUTO, RDFA
ImportError: cannot import name 'convert_graph'
[2019-04-19 03:15:54 +0000] [23073] [INFO] Worker exiting (pid: 23073)
[2019-04-19 03:15:54 +0000] [23070] [INFO] Shutting down: Master
[2019-04-19 03:15:54 +0000] [23070] [INFO] Reason: Worker failed to boot. |
Hi Edmond, The problem has already been fixed in master, but no new release made yet. Two ways you can fix this now in your application:
|
As reported by a pySHACL user @ChrisGithubWork in this issue: RDFLib/pySHACL#19
On windows, when pyshacl issues
from owlrl import convert_graph
, python tries to import it from theowlrl.py
command-line script file, rather than the module namedowlrl
.I don't know if that happens on all windows installations? Nobody else has reported anything similar.
Perhaps it is only an issue if the "C:\Python35\Scripts" directory is in the PYTHON_PATH?
Anyway, this will probably go away in the next release of OWL-RL because the commandline script files no longer have a .py extension (to be more compatible with Debian packaging) so in theory that would cause python to not try to import that file as a module anymore.
The text was updated successfully, but these errors were encountered: