Giter Site home page Giter Site logo

Comments (4)

EeyoreLee avatar EeyoreLee commented on August 28, 2024

@concretevitamin - hi, cause Python3.7 is end-of-life. You can use the yapf.interpreter property to select a python interpreter that 3.8 or higher. like the following

"yapf.interpreter": "/conda/envs/xxx/bin/python"

from vscode-extension-yapf.

concretevitamin avatar concretevitamin commented on August 28, 2024

@EeyoreLee Thanks. I've added this to settings.json (Python 3.8 conda env):

{
    "yapf.interpreter": ["/Users/me/anaconda/envs/py38/bin/yapf"],
}

But yapf still fails to work. The Output tab on VSCode start up shows:

2023-11-19 20:00:03.916 [info] Name: yapf
2023-11-19 20:00:03.916 [info] Module: yapf
2023-11-19 20:00:06.601 [error] Python version undefined.undefined is not supported.
2023-11-19 20:00:06.601 [error] Selected python path: undefined
2023-11-19 20:00:06.601 [error] Supported versions are 3.7 and above.
2023-11-19 20:00:06.651 [info] Server run command: /Users/me/anaconda/envs/py38/bin/yapf /Users/me/.vscode/extensions/eeyore.yapf-2023.11.109102916/bundled/tool/lsp_server.py
2023-11-19 20:00:06.652 [info] Server: Start requested.
2023-11-19 20:00:06.891 [info] [Error - 8:00:06 PM] Server initialization failed.
2023-11-19 20:00:06.891 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2023-11-19 20:00:06.891 [info] [Info  - 8:00:06 PM] Connection to server got closed. Server will restart.
2023-11-19 20:00:06.891 [info] true
2023-11-19 20:00:06.891 [info] [Error - 8:00:06 PM] yapf client: couldn't create connection to server.
2023-11-19 20:00:06.891 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2023-11-19 20:00:07.141 [info] [Error - 8:00:07 PM] Server initialization failed.
2023-11-19 20:00:07.141 [info]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2023-11-19 20:00:07.141 [info] [Info  - 8:00:07 PM] Connection to server got closed. Server will restart.
2023-11-19 20:00:07.141 [info] true
2023-11-19 20:00:07.141 [info] [Error - 8:00:07 PM] yapf client: couldn't create connection to server.
...

The

2023-11-19 20:00:06.601 [error] Python version undefined.undefined is not supported.
2023-11-19 20:00:06.601 [error] Selected python path: undefined
2023-11-19 20:00:06.601 [error] Supported versions are 3.7 and above.

lines are weird -- the current window does have a 3.8 conda env activated. Any help?

from vscode-extension-yapf.

EeyoreLee avatar EeyoreLee commented on August 28, 2024

@concretevitamin - The value of yapf.interpreter is python interpreter, not yapf binary.

{
    "yapf.interpreter": ["/Users/me/anaconda/envs/py38/bin/python"],
}

from vscode-extension-yapf.

concretevitamin avatar concretevitamin commented on August 28, 2024

Oops, thanks. It works now.

from vscode-extension-yapf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.