-
Notifications
You must be signed in to change notification settings - Fork 334
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
Error: "pip install nnabla" on M1(M2)mac #1191
Comments
having the same problem. to give an explanation, it looks like there are linux ARM-specific (aarch64) builds, but no macOS ARM-specific builds: https://pypi.org/project/nnabla/#files |
here's how I built
# ensure homebrew is installed
echo ""
echo "making sure homebrew is installed..."
which brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# ensure clang is installed
echo ""
echo "making sure clang is installed..."
which clang || brew install llvm
# install cmake CLI (add binary and include paths for cmake to ~/.bash_profile)
echo ""
echo "installing cmake..."
DIRPATH_LOCAL_BIN="${HOME}/.local/bin"
DIRPATH_LOCAL_INCLUDE="${HOME}/.local/include"
echo "" >> ~/.bash_profile
echo "# cmake binary and include paths" >> ~/.bash_profile
echo "export C_INCLUDE_PATH=\"${DIRPATH_LOCAL_INCLUDE}\"" >> ~/.bash_profile
echo "export CPLUS_INCLUDE_PATH=\"${DIRPATH_LOCAL_INCLUDE}\"" >> ~/.bash_profile
echo "" >> ~/.bash_profile
echo "export PATH=\"${PATH}:${DIRPATH_LOCAL_BIN}\"" >> ~/.bash_profile
source ~/.bash_profile
brew install cmake
# download and copy protoc
echo ""
echo "installing protoc..."
URL_PROTOC="https://github.com/protocolbuffers/protobuf/releases/download/v23.0-rc3/protoc-23.0-rc-3-osx-aarch_64.zip"
cd "${HOME}/Downloads"
mkdir -p ./protoc/
curl -L "$URL_PROTOC" -o "$(basename $URL_PROTOC)" && unzip "$(basename $URL_PROTOC)" -d ./protoc/
cp protoc/bin/protoc "${DIRPATH_LOCAL_BIN}"
cp -R protoc/include/google "${DIRPATH_LOCAL_INCLUDE}"
rm -rf protoc/ "$(basename $URL_PROTOC)"
which protoc || echo "ERROR: failed to install protoc!"
|
@YukioOobuchi I'm not sure how |
might have to swap to fix this error upon mes-MacBook-Pro:nnabla me$ python
Python 3.10.11 (main, May 7 2023, 19:48:21) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nnabla
2023-05-07 20:10:54,252 [nnabla][INFO]: Initializing CPU extension...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/me/.pyenv/versions/3.10.11/lib/python3.10/site-packages/nnabla/__init__.py", line 34, in <module>
from .parameter import (
File "/Users/me/.pyenv/versions/3.10.11/lib/python3.10/site-packages/nnabla/parameter.py", line 29, in <module>
import nnabla.utils.nnabla_pb2 as nnabla_pb2
File "/Users/me/.pyenv/versions/3.10.11/lib/python3.10/site-packages/nnabla/utils/nnabla_pb2.py", line 8, in <module>
from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/Users/me/.pyenv/versions/3.10.11/lib/python3.10/site-packages/google/protobuf/internal/__init__.py) |
Thanks for creating and managing such a nice package.
I am using M2 mac.
The following commands, which are first instructed in official documents, etc., will result in an execution error.
The documentation says that "mac" is also supported, but I wonder if "intel" and "apple silicon" are both supported.
Also, I would be very happy if you could provide some possible solutions for the "apple silicon" if it is supported.
The execution environment is described below.
If you need more information, please let us know.
We sincerely look forward to your response.
【PC environment】
【tried】
I tried using "pyenv" and multiple python versions, but all gave the same execution error.
【addition】
I tried "pip install nnabla" under "intel mac". on my own intel Mac, it installed without any problem.
The text was updated successfully, but these errors were encountered: