Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied when installing Pylint on VSCode

When trying to enable linting with Pylint, and format on save with autopep8, neither will install because of a permission denied error.

Pylint:

IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/mccabe.py'

Autopep8:

IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pep8.py'
like image 556
swade Avatar asked Jan 18 '17 15:01

swade


People also ask

How do I get Pylint on VSCode?

To enable linters, open the Command Palette (Ctrl+Shift+P) and select the Python: Select Linter command. The Select Linter command adds "python. linting.

What is Linter Pylint not installed?

by diehard. VSCode is a lightweight, open source, cross-platform code editor.

How do you check if I have Pylint installed?

First, to check the version of Pylint you're running, run the following command: pylint --version.


2 Answers

You can press ⬆ (up arrow key) in the terminal tab after the install fails to return to the command that it ran. In this case:

/usr/bin/python -m pip install pylint

Press fn+⬅ (left arrow key) to jump to the beginning of the line, then insert a 'sudo ' (no quotes, but including the trailing space) in front of the command, and press enter to re-run the command as root -- it should look like this:

sudo /usr/bin/python -m pip install pylint

You will be prompted for your password then the package will be installed without permissions errors.

like image 82
user423430 Avatar answered Nov 14 '22 21:11

user423430


Run this command:

sudo chown -R $USER /Library/Python/2.7
like image 29
McGrady Avatar answered Nov 14 '22 22:11

McGrady