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

python could not load uberseg #10

Open
bnord opened this issue Oct 6, 2015 · 5 comments
Open

python could not load uberseg #10

bnord opened this issue Oct 6, 2015 · 5 comments

Comments

@bnord
Copy link

bnord commented Oct 6, 2015

import meds
could not load fast ubserseg


python version:
Python 2.7.10 |Anaconda 2.0.1 (x86_64)| (default, May 28 2015, 17:04:42)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin

os: mavericks

@esheldon
Copy link
Owner

esheldon commented Oct 7, 2015

Was that the entire message?

@bnord
Copy link
Author

bnord commented Oct 7, 2015

Unfortunately that was the entire message. It did import though. Just installed it. Will be trying to use it in the next few days.

Sent from my mobile.

On Oct 7, 2015, at 09:01, Erin Sheldon notifications@github.com wrote:

Was that the entire message?


Reply to this email directly or view it on GitHub.

@esheldon
Copy link
Owner

esheldon commented Oct 7, 2015

@beckermr any idea why your C extension didn't import?

@beckermr
Copy link
Collaborator

beckermr commented Oct 7, 2015

This message was put in by design. I wrote the code so that if the C extension failed to import, it would revert back to the python version. (This is for stability since the meds code should almost never fail.) See the code here at line 26 of meds.py

try:
    from . import _uberseg
    _have_c_ubserseg=True
except ImportError:
    print("could not load fast ubserseg")
    _have_c_ubserseg=False

In order to diagnose this, please send the following.

  1. The terminal output from when you installed the code the first time.
  2. Go ahead and comment out the try...except above and just use a direct import like this
    python import _uberseg
    Then send the output of this as well.

@astro-friedel
Copy link

I have also been running into this issue. I am working with both python 2 and python 3 builds. With python 2 I have no issues, but with python 3 (3.7.4) I get the "could not load fast ubserseg" message. Looking deeper I see that the library is named _uberseg.cpython-37m-x86_64-linux-gnu.so rather than _ubserseg.so. If I correct the name I get an import error:
ImportError: dynamic module does not define module export function (PyInit__ubserseg)

From some brief googling it looks like there are some differences in the way external python modules are coded between python2 and 3.

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