[protobuf installation on MAC] 맥에서 프로토버프 설치
2020. 6. 11. 01:37ㆍpython
728x90
반응형
1. Unix tools 사용을 위해 앱스토어에서 Xcode 설치
2. 터미널에서
sudo xcode-select --install
3. "port"설치를 위해 www.macports.org/에 접속 -> 운영체제에 맞는 .pkg 설치.
4. 터미널에서
sudo /opt/local/bin/port install autoconf automake libtool
5. github.com/protocolbuffers/protobuf/releases 에서 필요한 파일 다운로드 (예. protobuf-python-3.12.3.tar.gz )
6. tar 파일이나 zip 파일 압축 풀린 경로로 들어가서(cd /경로/protobuf-3.12.3)
./configure
# ./configure --prefix=/usr
# default로 /usr/local에설치 되는데 많은 플랫폼에서 /usr/local/lib 는 LD_LIBRARY_PATH에 일부가 아니다.path설정해도 되고 /usr 에 설치해도 된다.
# 맥에서 ./configure --prefix=/usr 로설치하니 make check시 error 보고 된다.
make
make check
sudo make install
sudo ldconfig # refresh shared library cache.
7. 버전확인 버전이 나오지않을경우 다시 설치
protoc --version
8.
코드 실행시 AttributeError: 'module' object has no attribute 'Default' 에러가 나서
virtual env 에서 pip install --upgrade protobuf
반응형
'python' 카테고리의 다른 글
[파이참 PyCharm] 단축키 (0) | 2020.12.15 |
---|---|
[파이썬 python] print(), sep='', end='' (0) | 2020.12.09 |
plt.plot 한글 폰트 깨짐 현상 (0) | 2020.08.03 |
[Anaconda Python 32bit, 64bit]아나콘다 가상환경을 이용한 파이썬 32bit/64bit 동시 사용 (0) | 2020.06.30 |
[pip] python pip 설치 on centos7 (0) | 2020.05.29 |