error: could not create 'xxxxxx': Permission denied

博主在重新安装Python2.7时,使用pip install python2命令报错,提示没有权限创建文件夹。解决办法是将目标文件夹赋予权限,然后输入密码即可完成安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

先说解决办法————将目标文件夹赋予权限即可:

 sudo chmod -R 777 xxxxxx

然后输入密码。

我再重新安装python27的时候遇到了这个问题 pip install python2 时候报错信息如下:

    creating build/temp.macosx-10.14-intel-2.7
    creating build/temp.macosx-10.14-intel-2.7/src
    creating build/temp.macosx-10.14-intel-2.7/src/wrapt
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/wrapt/_wrappers.c -o build/temp.macosx-10.14-intel-2.7/src/wrapt/_wrappers.o
    cc -bundle -undefined dynamic_lookup -Wl,-F. build/temp.macosx-10.14-intel-2.7/src/wrapt/_wrappers.o -o build/lib.macosx-10.14-intel-2.7/wrapt/_wrappers.so
    running install_lib
    creating /Library/Python/2.7/site-packages/wrapt
    error: could not create '/Library/Python/2.7/site-packages/wrapt': Permission denied
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/st/r_c40wz94cnf4c426r0lvp600000gn/T/pip-install-ZMSUBx/wrapt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/st/r_c40wz94cnf4c426r0lvp600000gn/T/pip-record-fAAmbu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/st/r_c40wz94cnf4c426r0lvp600000gn/T/pip-install-ZMSUBx/wrapt/
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值