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

Loading ontologies fails (for me) in 2.4.4 #158

Open
mwalzer opened this issue Mar 15, 2022 · 3 comments
Open

Loading ontologies fails (for me) in 2.4.4 #158

mwalzer opened this issue Mar 15, 2022 · 3 comments
Labels
bug Issues or pull requests that specify a bug. external An issue related to an external dependency or project.

Comments

@mwalzer
Copy link

mwalzer commented Mar 15, 2022

Hi!
I updated to the latest version (from 2.something<2) but immediately ran into trouble testing in a fresh venv:

>>> psi = pronto.Ontology.from_obo_library("psi-ms.obo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/pronto/lib/python3.6/site-packages/pronto/ontology.py", line 207, in from_obo_library
    f"http://purl.obolibrary.org/obo/{slug}", import_depth, timeout, threads
  File "/tmp/pronto/lib/python3.6/site-packages/pronto/ontology.py", line 283, in __init__
    cls(self).parse_from(_handle)  # type: ignore
  File "/tmp/pronto/lib/python3.6/site-packages/pronto/parsers/rdfxml.py", line 89, in parse_from
    raise ValueError("could not find `owl:Ontology` element")
ValueError: could not find `owl:Ontology` element

so I tried with something from the docs:

>>> apo = pronto.Ontology.from_obo_library("apo.obo")
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `0`,
 right: `0`: Python threading is not initalized and the `auto-initialize` feature is not enabled.

Consider calling `pyo3::prepare_freethreaded_python()` before attempting to use Python APIs.', /tmp/pip-req-build-o2_6liwv/build/temp.linux-x86_64-3.6/cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-0.15.1/src/gil.rs:233:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/pronto/lib/python3.6/site-packages/pronto/ontology.py", line 207, in from_obo_library
    f"http://purl.obolibrary.org/obo/{slug}", import_depth, timeout, threads
  File "/tmp/pronto/lib/python3.6/site-packages/pronto/ontology.py", line 283, in __init__
    cls(self).parse_from(_handle)  # type: ignore
  File "/tmp/pronto/lib/python3.6/site-packages/pronto/parsers/obo.py", line 18, in parse_from
    doc = fastobo.iter(handle, ordered=True)
pyo3_runtime.PanicException: assertion failed: `(left != right)`
  left: `0`,
 right: `0`: Python threading is not initalized and the `auto-initialize` feature is not enabled.

Consider calling `pyo3::prepare_freethreaded_python()` before attempting to use Python APIs.

which left me with more unknowns, so I tried from local obo to rule out connection or networking-lib issues:

>>> psi = pronto.Ontology('psi-ms.obo')
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `0`,
 right: `0`: Python threading is not initalized and the `auto-initialize` feature is not enabled.

Consider calling `pyo3::prepare_freethreaded_python()` before attempting to use Python APIs.', /tmp/pip-req-build-o2_6liwv/build/temp.linux-x86_64-3.6/cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-0.15.1/src/gil.rs:233:21
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/pronto/lib/python3.6/site-packages/pronto/ontology.py", line 283, in __init__
    cls(self).parse_from(_handle)  # type: ignore
  File "/tmp/pronto/lib/python3.6/site-packages/pronto/parsers/obo.py", line 18, in parse_from
    doc = fastobo.iter(handle, ordered=True)
pyo3_runtime.PanicException: assertion failed: `(left != right)`
  left: `0`,
 right: `0`: Python threading is not initalized and the `auto-initialize` feature is not enabled.

Consider calling `pyo3::prepare_freethreaded_python()` before attempting to use Python APIs.

The errors differ, but I assume they still might be connected somewhere. What could it be?

@mwalzer
Copy link
Author

mwalzer commented Mar 15, 2022

copy paste Details:
Environment

/tmp$ python3 -m venv pronto && source pronto/bin/activate
(pronto) /tmp$ pip3 install pronto

Versions

Python 3.6.9 (default, Dec  8 2021, 21:08:43) 
[GCC 8.4.0] on linux
>>> import pronto
>>> pronto.__version__
'2.4.4'

@althonos
Copy link
Owner

Hi @mwalzer ; this looks like a fastobo issue related to threading. Could you run the following and paste the result in a comment?

import pprint
import fastobo
pprint.pprint(fastobo.__build__)

@althonos althonos added bug Issues or pull requests that specify a bug. external An issue related to an external dependency or project. labels Mar 15, 2022
@mwalzer
Copy link
Author

mwalzer commented Mar 16, 2022

Here it is:fastobo_build.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or pull requests that specify a bug. external An issue related to an external dependency or project.
Projects
None yet
Development

No branches or pull requests

2 participants