通过 pip 安装 simplejson 时出错 (OS X Yosemite)

Error while installing simplejson via pip (OS X Yosemite)

当我试图通过 pip 安装包 soundcloud 时,我收到警告:

Error: could not create '/Library/Python/2.7/site-packages/simplejson': P error: could not create '/Library/Python/2.7/site-packages/simplejson': Permission denied

因此,我使用文件管理器递归地将文件夹权限设置为 777。

我运行再次pip安装soundcloud。收到警告:

simplejson/_speedups.c:2640:42: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            int int_as_string_bitcount_val = PyLong_AsLong(int_as_string_bitcount);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
    cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.10-intel-2.7/simplejson/_speedups.o -o build/lib.macosx-10.10-intel-2.7/simplejson/_speedups.so

虽然根据 pip list soundcloud 及其依赖项 (simplejson 3.6.5) 已安装,但我想知道我是否必须对这个警告做些什么,如果这个问题的答案是 "yes" 那么"what"。

这个错误不会对你造成太大影响,除非你做的是超精确的数学运算,例如登月、运行在证券交易所等。

以后还会使用 sudo pip,它会询问您的密码,然后 运行 pip as "root"。类似于 windows 中的 "run as administrator"。此外,您不会破坏您的权限设置。