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 torch" failed #1618

sherkwast opened this issue May 23, 2017 · 3 comments


None yet
4 participants
Copy link

commented May 23, 2017

I installed pytorch and torchvision using pip on alpine container, then it gave the following error.

ImportError: Error loading shared library No such file or directory (needed by /usr/

ImportError: Error relocating /usr/lib/python3.5/site-packages/torch/lib/ __strtod_internal:
symbol not found


This comment has been minimized.

Copy link

commented May 23, 2017

Looks like (NVIDIA
s CuDNN library) links against glibc.
Alpine provides musl as it's standard library, which misses the symbol __strtod_internal which is glibc specific.
I am not sure what to do here other than try to page nvidia folks. cc: @ngimel to alert appropriate folks.

The first error: ImportError: Error loading shared library seems to be an issue with your python installation and not pytorch itself.

Since either of these errors are not in our scope of fixing (1st is your python install, 2nd is a NVIDIA CuDNN issue, and CuDNN is a blackbox), I'll tag these as dependency bugs and close the issue.
If you do not plan to use GPUs, then you can install PyTorch from source on your machine without installing CUDA or CuDNN and it'll work for you. Instructions are here:

@soumith soumith closed this May 23, 2017


This comment has been minimized.

Copy link

commented May 25, 2017

Got an answer from cudnn that alpine is not supported and won't be supported.


This comment has been minimized.

Copy link

commented Aug 16, 2017

You can use this Dockerfile. This is built over ubuntu. You can also try using datmo in order setup environment and track machine learning projects for making models reproducible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.