Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If formatter not installed we do not always offer installation #524

Closed
MikhailArkhipov opened this issue Jan 3, 2018 · 6 comments
Closed
Assignees
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@MikhailArkhipov
Copy link

MikhailArkhipov commented Jan 3, 2018

Environment data

VS Code version: 1.19
Python Extension version: 0.9
Python Version: 3.6
OS and version: Windows 10

autopep8 is missing and I get

Formatting with autopep8 failed.
Error: C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe: 
No module named autopep8

Actual error does contain No module named but in

const isModuleNoInstalledError = errorObj.code === 1 && error.message.indexOf('No module named') >= 0;

code is null

Also, output to the status bar is truncated and does not look like an error message

image

Also, it looks like in

            const isInstalled = await installer.isInstalled(this.product, resource);
            if (isInstalled) {

should be !isInstalled

@MikhailArkhipov MikhailArkhipov self-assigned this Jan 3, 2018
@MikhailArkhipov MikhailArkhipov added area-formatting bug Issue identified by VS Code Team member as probable bug labels Jan 3, 2018
@MikhailArkhipov
Copy link
Author

Attempt to install yields

PermissionError: [WinError 5] 
Access is denied: 
'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\Lib\\site-packages\\yapf

@MikhailArkhipov
Copy link
Author

Got this fixed and implemented elevated install

@brettcannon
Copy link
Member

For installing globally you should use python3 -m pip install --user autopep8

@MikhailArkhipov
Copy link
Author

Don't --user means 'per user'? We can do per user (which may or may not be desirable). My implementation uses standard setup if target folder is writable and attempts elevated if not.

@brettcannon
Copy link
Member

Yes, --user means per user account on the machine. I really do not want to promote elevated, global installs anywhere as that's considered bad practice in the Python community. I also don't like global installs even if they don't require elevation since you can't control those installs as well and you typically don't want to force packages on all users of a machine (and if you only have one user then a user install doesn't affect anything).

@MikhailArkhipov
Copy link
Author

321e204

@brettcannon brettcannon added this to the January 2018 milestone Jan 5, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants