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 error GLIBCXX_3.4.21 not found when importing numbuf. #131

Closed
robertnishihara opened this issue Dec 17, 2016 · 4 comments
Closed

Comments

@robertnishihara
Copy link
Collaborator

I followed the installation instructions on a fresh Ubuntu VM using Anaconda with Python 3 (though I am pretty sure I have seen this error with Python 2 as well).

Ray builds and installs fine. However, if I try to run runtest.py (or simply import numbuf), I get the following error.

Traceback (most recent call last):
  File "test/runtest.py", line 6, in <module>
    import ray
  File "/home/ubuntu/ray/lib/python/ray/__init__.py", line 16, in <module>
    import ray.serialization
  File "/home/ubuntu/ray/lib/python/ray/serialization.py", line 6, in <module>
    import numbuf
  File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/numbuf-0.0.1-py3.5.egg/numbuf/__init__.py", line 5, in <module>
    from numbuf.libnumbuf import *
ImportError: /home/ubuntu/anaconda3/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/ubuntu/anaconda3/lib/python3.5/site-packages/numbuf-0.0.1-py3.5.egg/numbuf/libnumbuf.so)

I followed one of the solutions here http://askubuntu.com/questions/575505/glibcxx-3-4-20-not-found-how-to-fix-this-error, which suggested running the following.

conda install libgcc

That fixed the problem.

Should we specifically look for this error and print something more helpful? Or should we change the installation instructions to mention this potential problem?

@mehrdadn
Copy link
Contributor

IMO it's always better to assume no one will read the instructions. :)

@robertnishihara
Copy link
Collaborator Author

Good point.

Feels a bit hacky, but we could edit numbuf/numbuf/__init__.py to be something like

try:
  from numbuf.libnumbuf import *
except ImportError as e:
  if "GLIBCXX" in str(e):
    raise ImportError("SOME ERROR MESSAGE... Try running `conda install libgcc`.")

@mehrdadn
Copy link
Contributor

That'd probably work. But always print the original error message too; don't suppress it.

@robertnishihara
Copy link
Collaborator Author

Agreed.

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

2 participants