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

import libsbml results in error #475

Open
hsauro opened this issue Sep 12, 2020 · 14 comments
Open

import libsbml results in error #475

hsauro opened this issue Sep 12, 2020 · 14 comments
Assignees

Comments

@hsauro
Copy link
Contributor

hsauro commented Sep 12, 2020

I don't know if this has been reported before but I noticed that loading libsbml gives the following error, is it because I have an old libsbml installed?

import libsbml
Traceback (most recent call last):

File "", line 1, in
import libsbml

File "C:\Users\hsauro\AppData\Roaming\Python\Python37\site-packages\libsbml_init_.py", line 94285, in
class DynPkgNamespaces(SBMLNamespaces):

File "C:\Users\hsauro\AppData\Roaming\Python\Python37\site-packages\libsbml_init_.py", line 94346, in DynPkgNamespaces
swig_destroy = _libsbml.delete_DynPkgNamespaces

AttributeError: module '_libsbml' has no attribute 'delete_DynPkgNamespaces'

@luciansmith
Copy link
Contributor

libsbml doesn't officially come with tellurium--you have to use 'tesbml' instead. But it still uses the 'libsbml' directory, so it might get confused?

The actual solution is to just move to using the official libsbml release instead of the tesbml thing; I'll be looking into how best to do that. I know the various Frank-supported packages are basically ready.

@fbergmann
Copy link

yeah ... i think it would be best to not have the confusion about hte two packages. it would be fine for tellurium to depend on python-libsbml-experimental. Packages are up at pypi and conda-forge, so it should be no problem for you to switch.

@matthiaskoenig
Copy link
Collaborator

matthiaskoenig commented Sep 14, 2020 via email

@hsauro
Copy link
Contributor Author

hsauro commented Sep 14, 2020 via email

@fbergmann
Copy link

@matthiaskoenig , i am aware of that ... but as i demonstrated at HARMONY, even the tesbml/sedml/numl/combine packages overwrite each others symbols. It is just the way the SWIG wrappers are generated. Thus i was proposing of minimizing the additional work done.

@luciansmith
Copy link
Contributor

Is the 'overwriting symbols' problem written up anywhere? And Frank, are you saying that creating 'tesbml' doesn't actually solve the problem?

When I asked Kyle the reasoning behind the tesbml thing, he just said it was to ensure versioning, not to solve any symbol overwriting issue. (And of course, there's the separate issue of Python dumping all dlls into the same place, meaning you can't have two different libX.dll files. I believe this problem was solved through making everything static, however.) I'd like to understand what the issues are here before trying to make a change one way or the other.

@fbergmann
Copy link

Have a look at this issue for a worked example and workaround:

fbergmann/libSEDML#21

the same issue does apply to tesbml as well.

I'm not sure how versioning applies here. I mean you have just one requirements.txt file in which you prescribe what version of the packages you want for a specific version of tellurium. Having the packages duplicated for that does seem like a strain on resources. But maybe i don't quite understand the issue yet. In general if there are issues with interoperability of the libraries, i would prefer that an issue is filed for the main packages, so that they can be resolved, rather than the project forked over and over again.

@matthiaskoenig
Copy link
Collaborator

matthiaskoenig commented Sep 16, 2020 via email

@fbergmann
Copy link

i mean .. if there is a bug with the interpreter dying then maybe someone could report that to the upstream libraries, as it would be good to know ... as i'm quite sure it would be fixable there. I mean the interpreter dying, rather than giving an exception, would happen, in case there was an exception thrown that wasn't caught. @matthiaskoenig do you have an example that crashes right now with libsbml + sedml / combine? i still have not released new numl binaries ... so don't use that one yet ... its close to being done though.

@fbergmann
Copy link

by now i released a new libnuml after the same approach, just in case that caused the issue:

https://pypi.org/project/python-libnuml/

@luciansmith
Copy link
Contributor

Thanks, Frank! We'll also need the python 3.8 version, too (we're currently supporting 3.6, 3.7, and 3.8).

Matthias, I'm still not sure if the te* versions of things actually fix anything (like Python crashing) or not.

@fbergmann
Copy link

@luciansmith i see 3.8 numl binaries there, where did you find one missing?

@luciansmith
Copy link
Contributor

Hmm, I swear they weren't there when I first checked yesterday, but they are indeed there today. Maybe it was a cache thing. Anyway, thanks!

@matthiaskoenig
Copy link
Collaborator

matthiaskoenig commented Sep 18, 2020 via email

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

4 participants