MacでPythonのnumpyライブラリをインストールして失敗した解決方法

970 ワード

numpyライブラリのインストール中に、次のようなエラーが発生しました.
インストールコマンド:
easy_install numpy

エラー:
MacdeMacBook-Pro-3:python mac$ easy_install numpy
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-785.write-test'

何が原因ですか.エラーメッセージを解析することで、「[Errno 13]Permission denied:」は権限の問題であり、スーパー管理者権限が必要です.
sudo easy_install numpy

インストールに成功しました:
MacdeMacBook-Pro-3:python mac$ sudo easy_install numpy
Password:
Searching for numpy
Best match: numpy 1.6.2
Adding numpy 1.6.2 to easy-install.pth file

Using /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Processing dependencies for numpy
Finished processing dependencies for numpy
MacdeMacBook-Pro-3:python mac$