[Python]error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/share':...

python在pip安装networkx时候出现这种错误

creating /System/Library/Frameworks/Python.framework/Versions/2.7/share
error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/share': Operation not permitted


image.png
解决方法:

安装时候加入 --user

sudo pip install networkx --ignore-installed networkx --user

你可能感兴趣的:([Python]error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/share':...)