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
MacOS install error: Library not loaded: @rpath/libc++.1.dylib #36941
Comments
Note that this error also occurs on
|
Does conda work for you? |
lib/python3.7/site-packages/torch/init.py", line 82, in |
Ok, I solved the issue, I don't know if it has any unwanted impact in any way but now Torch is working. I tested Torch with this script: from future import print_function It devolved: tensor([[0.3633, 0.7173, 0.6055], I hope it work for others. I have been 3 days trying to find solutions in Google but not any solution found it. |
Can confirm this method works on macOS running on Python 3.8 in venv |
Running this works on my side too.
Seems like something is not properly packaged along? |
Yes, it sounds like the rpath for libc++ is incorrectly set on the wheel packages. We should not be rpath'ing it at all. |
maybe connected to gh-35418, where rpaths to cuda libraries are suspected of causing problems |
Summary: It just depends on a single `torch_python` library. C library does not depend on standard C++ library and as result it closes pytorch#36941 Pull Request resolved: pytorch#39375 Reviewed By: orionr Differential Revision: D21840645 Pulled By: malfet fbshipit-source-id: c38fc793554c3b047acb45349a966c81554f4e5e
Summary: It just depends on a single `torch_python` library. C library does not depend on standard C++ library and as result it closes pytorch#36941 This is a cherry-pick of pytorch#39375 into release/1.5 branch
Summary: Closes gh-35418, PR gh-16414 added [the `CMAKE_INSTALL_RPATH_USE_LINK_PATH`directive](https://github.com/pytorch/pytorch/pull/16414/files#diff-dcf5891602b4162c36c2125c806639c5R16) which is non-standard and will cause CMake to write an `RPATH` entry for libraries outside the current build. Removing it leaves an RPATH entry for `$ORIGIN` but removes the entries for things like `/usr/local/cuda-10.2/lib64/stubs:/usr/local/cuda-10.2/lib64` for `libcaffe2_nvrtc.so` on linux. The added test fails before this PR, passes after. It is equivalent to checking `objdump -p torch/lib/libcaffe2_nvrtc.so | grep RPATH` for an external path to the directory where cuda "lives" I am not sure if it solve the `rpath/libc++.1.dylib` problem for `_C.cpython-37m-darwin.so` on macOS in issue gh-36941 Pull Request resolved: #37737 Differential Revision: D22068657 Pulled By: ezyang fbshipit-source-id: b04c529572a94363855f1e4dd3e93c9db3c85657
) Summary: Closes pytorchgh-35418, PR pytorchgh-16414 added [the `CMAKE_INSTALL_RPATH_USE_LINK_PATH`directive](https://github.com/pytorch/pytorch/pull/16414/files#diff-dcf5891602b4162c36c2125c806639c5R16) which is non-standard and will cause CMake to write an `RPATH` entry for libraries outside the current build. Removing it leaves an RPATH entry for `$ORIGIN` but removes the entries for things like `/usr/local/cuda-10.2/lib64/stubs:/usr/local/cuda-10.2/lib64` for `libcaffe2_nvrtc.so` on linux. The added test fails before this PR, passes after. It is equivalent to checking `objdump -p torch/lib/libcaffe2_nvrtc.so | grep RPATH` for an external path to the directory where cuda "lives" I am not sure if it solve the `rpath/libc++.1.dylib` problem for `_C.cpython-37m-darwin.so` on macOS in issue pytorchgh-36941 Pull Request resolved: pytorch#37737 Differential Revision: D22068657 Pulled By: ezyang fbshipit-source-id: b04c529572a94363855f1e4dd3e93c9db3c85657
Hi All Have the same issue with torchtext though (torch alone is fine) Python 3.7.7 (v3.7.7:d7c567b08f, Mar 10 2020, 02:56:16)
Tried the workaround but didn't work. LDD equivalent shows the following |
@puthurr what versions of PyTorch and TorchText are you trying to install? |
Just installing the latest available |
@puthurr I ran the solution suggested above
I managed to resolve it by upgrading to |
@malfet @wenqinglim thus importing torchtext works fine now. Not ideal but working. |
I have the same issue with torch audio, I ran the command above and face the same issues. |
Don't run "brew install libomp", it destroyed my environment , then i create a new environment, install other configurationγ |
I am also having trouble with some of the dependencies on Mac Big Sur, specifically yields
This is after changing the rpath using install_name_tool as @puthurr suggested Environment: |
upgrading to torch 1.6.0 solved the issue for me. |
i have basically the same problem but the library libshm.dylib is missing.
all answers i found to fix that say to install libomp, which i reinstalled but it didnt fix the issue, though for others that seemed to work in previous years. i cant find the library libshm in any lib folders on my machine. Im wondering if its included somewhere in libomp and how to point pytorch to it, or if it can be downloaded from somewhere else? i have the current torch version installed 1.11.0 with Python 3.9 on Mac Big Sur. Found the libshm library required for sharedmemory alloc on linux machines. |
@jskye Can you please run collect_env and post results here? (Or better open a separate issue) |
I received this error when installing DALLE2.
|
π Bug
Install on MacOS fails with pip.
To Reproduce
Google suggested doing this;
That unfortunately did not work.
Expected behavior
No error.
Environment
cc @ezyang @gchanan @zou3519 @bdhirsh @seemethere @malfet @walterddr
The text was updated successfully, but these errors were encountered: