Comments (6)
I'm using vscode, I have yapf installed and configured as per the instructions for formatting .py files.
I created a test.py file, which I opened with vscode and then right clicked and chose to format the document.
Then vscode prompted me with this message, "The "yapf" extension is configured to format programs, but not "Python"-files."
from vscode-extension-yapf.
This is a strange problem, I don't know what's happening, it's not working.
版本: 1.83.1 (user setup)
提交: f1b07bd25dfad64b0167beb15359ae573aecd2cc
日期: 2023-10-10T23:48:05.904Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045
from vscode-extension-yapf.
@Zacharia2 - Do you mean yapf
can format other program languages? But it not work for .py
file ? Can you show some output of the yapf
.
from vscode-extension-yapf.
@Zacharia2 - hi, I switch the version of vscode to 1.83.1 and reproduct it. It seems cause you click the knob when yapf extension is starting. It works when this message appears in the output
Can you try it again, or show me the output of yapf channel
from vscode-extension-yapf.
2023-10-25 20:50:33.050 [info] Name: yapf
2023-10-25 20:50:33.051 [info] Module: yapf
2023-10-25 20:50:33.051 [info] Python extension loading
2023-10-25 20:50:33.051 [info] Waiting for interpreter from python extension.
2023-10-25 20:50:35.181 [info] Python extension loaded
2023-10-25 20:50:35.699 [error] Python interpreter missing:
[Option 1] Select python interpreter using the ms-python.python.
[Option 2] Set an interpreter using "yapf.interpreter" setting.
Please use Python 3.7 or greater.
It looks like it's because I chose the wrong python interpreter.
I use conda as my python environment.
I switched to the proper python interpreter and the problem was solved, thank you very much for your reply.
from vscode-extension-yapf.
For vscode, probably the Python Environment Manager plugin will manage the python environment better. Using this plugin to quickly switch to the right python environment can solve this problem.
from vscode-extension-yapf.
Related Issues (20)
- yapf: input filenames did not match any python files - No formatting done. HOT 2
- Format Selection is formatting the entire file HOT 5
- Can we mention this in python extension blog? HOT 1
- Add a way to provide a path to a custom yapf executable HOT 1
- Trailing \ stripped when formatting in VS Code HOT 8
- Not working if there's ipython magic function in cell HOT 20
- Path to .style.yapf HOT 5
- Yapf formatter with devcontainers not sticking HOT 3
- Range Formatting HOT 6
- Trailing empty line added to end of file / notebook cell HOT 4
- Python 3.7 is not supported HOT 2
- Formatting will be break for jupyter on `FormatOnType` mode if there are some magic function
- Cannot start server HOT 3
- Cannot handle new 3.12 f-strings, hangs up completely HOT 6
- Formatter is constantly formatting HOT 5
- The new version format: {year}.{month}.1{day}{hour}{minute}{second} HOT 1
- Yapf formatting on type instead of on save HOT 4
- Keep getting the message "there is no formatter for 'python' files installed" HOT 3
- SyntaxError for a Python 3.7 conda environment HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-extension-yapf.