0
votes

Here is my pip version

pip --version pip 10.0.1 from /Library/Python/2.7/site-packages/pip (python 2.7)

When I tried to install package like scapy in pip, here is the error:

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-install-3mdpz8/scapy/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/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-record-_qsfbp/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-install-3mdpz8/scapy/

And then I tried "sudo pip install setuptools --upgrade", and here is the error:

Could not install packages due to an EnvironmentError: [('/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', "[Errno 1] Operation not permitted: '/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] Operation not permitted: '/private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/System/Library/Frameworks/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] Operation not permitted: '/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] Operation not permitted: '/private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/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] Operation not permitted: '/private/var/folders/f8/988xffkd71v49lrmlxgl8r400000gn/T/pip-uninstall-ROqyV3/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

1
sudo pip install setuptools --upgrade. try pip install --upgrade setuptools.Natsfan
Are you running python2 or python3? If python3, how did you install it?Natsfan
Try to run pip with the '--user' flag as shown hereAndre

1 Answers

0
votes

Use the --user flag.

If you have installed python3 use pip3 instead of pip