-
Notifications
You must be signed in to change notification settings - Fork 22.1k
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
I can't import PyTorch, libomp.dylib can't be loaded. #20030
Comments
|
* Fix the error when importing torch (1.1.0) on osx pytorch/pytorch#20030 * Update torch version to 1.1.0 for linux * Update the doc for OS X about an external dependency on libomp
cc @JerryShih |
@ezyang Will all pytorch dependent libraries be backed into wheel package? Lines 738 to 825 in 2356fac
How about other dependent libraries? Are they all in third_party folder and built from source? |
pip doesn't know anything about brew, you can't ask it to brew install a package. Also, while this resolution "solves" the issue, I would love to better understand how this dependency came to be (in particular, why are we building binaries with a dependency on brew libraries? That sounds bad.) In some cases where we can't assume end users have a library installed, we distribute the library with our binaries. However, I'm not sure that we should do this for libomp.dylib. cc @soumith |
this is something that needs to be fixed. I can take a look at fixing binaries and re-uploading.
|
I can remove this dependency for the binaries. I'll put out a PR soon |
brew install libomp solves the proble |
when trying to upgrade pytorch from 1.0.1 to 1.1, I ran into the same issue and found this thread the update on linux server worked fine but not on my macbook (OSX) I tried brew install libomp but the brew formula could not be found, hence this did not fix the issue and I had to downgrade back to 1.0.1 on OSX to be able to import torch again did anyone have the same issue regarding both the pip install of pytorch and the brew install of libomp ? |
Is there still any plan to do this, or are new binary releases going to wait for the next PyTorch release? |
You need to install brew first, go to brew site and follow install instructions. |
thanks for your reply, I had brew installed but it was not enough up to date note for other users, when I did brew install libomp, it went through but other applications did not work anymore (Spyder IDE) ; at this moment my OS was still 10.11 (Capitan) and I had to upgrade to 10.12 (Sierra) to be able to solve the problem so from my experience, I would recommend upgrading to Sierra at least before installing pytorch 1.1 and libomp (I use pip and brew for all install) |
uploaded new binaries that remove dependency on |
Now I get |
@sukuya That sounds like a different problem, since it sounds like you're trying to compile PyTorch yourself, but this issue concerned a problem with the pre-compiled binaries. |
this issue still present in torch 1.1.0.post2, do you know when the fix will be available on stable release? |
@torrmal How are you making sure that you are using 1.1.0.post2? In my testing the changes introduced by 1.1.0.post2 fixed this problem completely, so I wonder whether you have a 1.1.0 non-post2 lying around somewhere that's getting picked up inadvertently. |
@alex-xnor I was compiling a c++ program which used prebuilt |
@sukuya can you make a new issue with more details on your problem? In particular, can you include the cmake/makefile that you are running and the compiler command that you are using? |
Thx bro I've solved my problem |
Does anyone have a suggestion for when brew install libomp doesn't work? I've reinstalled, relinked, but to no avail. |
put this in terminal,hope it works. It took me 2hrs to fix this and I hope you can fix it faster, jeeez... install_name_tool -change @rpath/libc++.1.dylib /usr/lib/libc++.1.dylib /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/_cvxcore.cpython-37m-darwin.so |
Don't run |
I also have the same issue when Launching Web UI with arguments:... Anyone have the same issue being solved? Installing requirements for Web UI |
I did the brew install libomp but didn't work for me. I'm working in c++ with libtorch though. But copying the installed limbomp files to the directory where my executable was solved the problem. I found them with 'brew info libomp' |
For C++ project, after installing libomp using
I manage to fix it by adding additional path to libtorch_cpu.dylib using this command: |
🐛 Bug
I tried to install PyTorch, but I can't use it. It can't link dynamic library libomp.dylib
To Reproduce
Steps to reproduce the behavior:
from torch.utils.data import Dataset
Expected behavior
Being able to use and import PyTorch
Environment
conda
,pip
, source): pipenvThe text was updated successfully, but these errors were encountered: