Error installing pylint on Mac OS

1

Good morning I'm working on Mac, python 2.7.10 and with VSCode and I get a notification saying the following: Linter pylint is not installed.

I click on install and start downloading but at the end it marks the following errors and for obvious reasons it does not install.

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 ma
in
    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 in
stall
    **kwargs
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, i
n 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 345, in move_whe
el_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  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, i
n makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/enum'

Thanks in advance.

    
asked by Samano Cedillo 17.06.2017 в 21:14
source

1 answer

2

The error occurs because superuser permissions are required to install applications in the system Python.

However, it is important to note that it is highly recommended NO to use that version of Python for development and it is also not advisable to install packages in that version.

Alternatively you can install Hombebrew or Pyenv and use them to install local versions of Python that do not conflict with the version of the system.

  

Note

     

To install the package indicated in the Python system version, you should use this command:

 sudo pip -H install pylint
     

in a terminal window.

    
answered by 18.06.2017 / 00:02
source