Nikiphor
Nikiphor

Reputation: 31

Yapf (a formatter for python files) in Sublime Text 3 doesn't work. Access is denied

When I press Ctrl + alt + F , It says :

OSError: [WinError 5] Access is denied

You may need to install YAPF and/or configure 'yapf_command' in PyYapf's Settings.

So I have already installed YAPF and configured in PyYapf's Settings :

// full path and command to run yapf
"yapf_command":"C:\\Users\\MyUserName\\AppData\\Local\\Programs\\Python\\Python37-32/Lib\\site-packages\\yapf",

What's wrong and with what? Why Yapf doesn't work. I've also installed a package of yapf.

Upvotes: 3

Views: 1649

Answers (1)

Dinko Pehar
Dinko Pehar

Reputation: 6061

There are 2 parts of problem:

  1. You may need to install YAPF
  2. Configure 'yapf_command' in PyYapf's Settings.

The first part can be solved by:

pip install yapf

In second part of problem, you need to configure path to the Yapf binary. In Linux, binaries go to /usr/bin/. I'm not completly sure for Windows equivalent, but try 1:

{
  "yapf_command": "C:/Users/your_user_name/AppData/Local/Programs/Python/Python37-32/Scripts/yapf.exe"
}

Upvotes: 1

Related Questions