Erro de permissão com o pip Python 3

Estou usando o Python 3 no Mac OS X. Tudo estava perfeito, eu costumava instalar pacotes como este:

pip install somePackage

Como o IDLE parou de funcionar, tive que reinstalá-lo. Depois disso, quando eu corri pip, eu conseguipip is not defined então eu tive que instalar o pip. Agora, toda vez que tento instalar um pacote usando o pip, recebo este erro:

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 377, in move_wheel_files
    clobber(source, dest, False, fixer=fixer, filter=filter)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 287, in clobber
    ensure_dir(dest)  # common for the 'include' path
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pygame'

Eu pensei que pode ser da versão, então eu atualizei. Agora, sempre que eu corropip install something Eu recebo este erro:

Comando "/ usr / bin / python -u -c" import setuptools, tokenize;Arquivo= '/ private / var / folders / bc / hwpn9sqn5352xcbst0p89snm0000gn / T / pip-build-hSNyxK / termcolor / setup.py'; f = getattr (tokenize, 'aberto', aberto) (Arquivo); code = f.read (). replace ('\ r \ n', '\ n'); f.close (); exec (compilação (código,Arquivo, 'exec')) "install --record /var/folders/bc/hwpn9sqn5352xcbst0p89snm0000gn/T/pip-U3ZtNq-record/install-record.txt - única versão - gerenciada externamente --compile" falhou com o código de erro 1 em / particular / var / pastas / bc / hwpn9sqn5352xcbst0p89snm0000gn / T / pip-build-hSNyxK / termcolor /

Não consigo nem excluir um pacote - quando executopip uninstall something Eu recebo este erro:

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/uninstall.py", line 76, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 346, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/bc/hwpn9sqn5352xcbst0p89snm0000gn/T/pip-OQKY_a-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'

Minha versão do pip é:

pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)

Estou usando o Mac 10.12.6

Como posso consertar isso?

questionAnswers(1)

yourAnswerToTheQuestion