LoginSignup
0
1

More than 1 year has passed since last update.

Python3.9 で nagisa をインストールする on M1 Mac

Last updated at Posted at 2021-05-28

やりたいこと

nagisa をインストールしたい。nagisa については以下参照。

インストールの手順

必要なもののインストール

brew install cmake eigen

pkg-config で見つかるようにパスを通す。~/.zshrc に以下の行を追加

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/homebrew/share/pkgconfig

エラー対策

pip install dynet に失敗

error: Could not download Eigen from 'https://github.com/clab/dynet/releases/download/2.1/eigen-b2e267dc99d4.zip': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>

これは、Certificate の設定が無いかららしい。そこで、

以下のコマンドを実行

/Applications/Python\ 3.9/Install\ Certificates.command 

import nagisa で失敗

以下のエラーで import できない

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_dynet.cpython-39-darwin.so, 2): Library not loaded: /private/var/(中略)/dynet/libdynet.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_dynet.cpython-39-darwin.so
  Reason: image not found

Path が無いかららしい

以下のパス設定で import に成功

export DYLD_LIBRARY_PATH=$(dirname $(which python3))/../lib:$DYLD_LIBRARY_PATH
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1