Mac下安裝Python的numpy庫失敗的解決方法

weixin_33807284發表於2016-07-02

在安裝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$

相關文章