安装turicreate时出错

Error when installing turicreate

我正在尝试在我的设备上安装一个名为 turicreate 的包。我想在 python 2.7

编写的代码中使用它

我的设备上同时安装了 python 3.6 和 python 2.7,所以我正在尝试使用命令:

$ python2.7 -m pip install turicreate

然后我得到这个错误:

Running setup.py install for prettytable ... error
Complete output from command /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-build-Uya2Ub/prettytable/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-3wU21B-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying prettytable.py -> build/lib
running install_lib
copying build/lib/prettytable.py -> /Library/Python/2.7/site-packages
error: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/prettytable.py'

----------------------------------------
Command "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-build-Uya2Ub/prettytable/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-3wU21B-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/4d/3qphp3b56cjdhdqh3jcv994r0000gn/T/pip-build-Uya2Ub/prettytable/

有人可以提出这个问题的解决方案吗?

谢谢,

安倍

PS:我在 Mac 并在终端中执行此操作。

此错误表示您没有管理员权限写入字典。为了获得此权限,您需要使用 sudo 前缀。

sudo python2.7 -m pip install turicreate