[Django] transformers 설치 in mac

Seojin Kwak·2022년 7월 13일
0

mac에서 pip3 install transformers 명령을 실행하면 제대로 실행되지 않는다. 팀원이 올려준 requirements.txt를 그냥 설치하기 전 몇몇 과정을 거쳐야 한다.

rust compiler 설치

그냥 rust 홈페이지에 나와있는 명령어대로 설치하다보면 bash profile이 어쩌구저쩌구 에러가 발생한다.

curl https://sh.rustup.rs -sSf | bash -s -- -y --no-modify-path

꼭 no modify path 옵션이 필요하다.

그 뒤, 환경변수 설정이 필요하다. 아래의 두 명령어를 home shell에서 실행.

echo 'export PATH="${HOME}/.cargo/bin:${PATH}"' >> ~/.zshrc
exec $SHELL

transformers 설치

pip3 install transformers

추가!!!!

sentence transformers 설치

마찬가지로 mac에서 한 번에 설치를 실패했다^^

brew install cmake
brew install pkg-config

sentence transformers에는 sentencepiece라는 모듈이 필요한데, 이 모듈 설치에서 엄청 막혔다.
https://github.com/google/sentencepiece
여기에 나와있는 build 모듈을 설치해줬다 위처럼.
그러고,
pip3 install sentence_transformers 해주면 성공

profile
Hello, World!

0개의 댓글

Powered by GraphCDN, the GraphQL CDN