这是我的点子版本
pip --version 来自/Library/Python/2.7/site-packages/pip(python 2.7)的pip 10.0.1
当我尝试在pip中安装诸如scapy之类的软件包时,出现以下错误:
命令“ / usr / bin / python -u -c”导入设置工具,标记化; 文件 ='/ private / var / folders / f8 / 988xffkd71v49lrmlxgl8r400000gn / T / pip-install-3mdpz8 / scapy / setup.py'; f = getattr(tokenize,'open',open)(文件); code = f.read()。replace('\ r \ n','\ n '); f.close(); exec(compile(code, file ,'exec')))安装--record / private / var / folders / f8 / 988xffkd71v49lrmlxgl8r400000gn / T / pip-record -_qsfbp / install-record.txt-“单一版本-外部管理-编译”失败,错误代码为/ private / var / folders / f8 / 988xffkd71v49lrmlxgl8r400000gn / T / pip-install-3mdpz8 / scapy / >
然后我尝试了“ sudo pip install setuptools --upgrade”,这是错误:
由于环境错误而无法安装软件包:[('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc','/ private / var / folders /f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc',“ [错误1]不允许的操作:' /private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'“),('' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/init.py','/ private / var / folders / f8 / 988xffkd71v49lrmlxgl8r400000gn / T / pip -uninstall-ROqyV3 / System / Library / Frameworks / Python.framework / Versions / 2.7 / Extras / lib / python / _markerlib / init .py',“ [Errno 1]不允许的操作:'/专用/ var /文件夹/ f8 / 988xffkd71v49lrmlxgl8r400000gn / T / pip-uninstall-ROqyV3 / System / Library / Framework s / Python.framework / Versions / 2.7 / Extras / lib / python / _markerlib / init .py'“),('/ System / Library / Frameworks / Python.framework / Versions / 2.7 / Extras /lib/python/_markerlib/markers.py','/private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/ python / _markerlib / markers.py',“ [Errno 1]不允许的操作:'/private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/System/Library/Frameworks/Python.framework/Versions/ 2.7 / Extras / lib / python / _markerlib / markers.py'“),('/ System / Library / Frameworks / Python.framework / Versions / 2.7 / Extras / lib / python / _markerlib / init .pyc','/ private / var / folders / f8 / 988xffkd71v49lrmlxgl8r400000gn / T / pip-uninstall-ROqyV3 / System / Library / Frameworks / Python.framework / Versions / 2.7 / Extras / lib / python / _markerlib / init .pyc',“ [Errno 1]不允许操作:'/ private / var / folders / f8 / 988xffkd71v49lrmlxgl8r400000gn / T / pip-uninstall-R OqyV3 / System / Library / Frameworks / Python.framework / Versions / 2.7 / Extras / lib / python / _markerlib / init .pyc'“),('/System/Library/Frameworks/Python.framework /Versions/2.7/Extras/lib/python/_markerlib'、'/private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/ lib / python / _markerlib',“ [Errno 1]不允许的操作:'/private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/System/Library/Frameworks/Python.framework/Versions/2.7/ Extras / lib / python / _markerlib'“)]
答案 0 :(得分:0)
使用--user
标志。
如果您已安装python3,请使用pip3
代替pip