5

I've been using VS Code from a week and I want to use VS Code built-in Python snippets but it is not working for me. I've tried JS snippets and it is working fine in VS Code but Python snippets are not working.

Image links:

JS Snippet: enter image description here PY snippet: enter image description here

3
  • you mean code auto completion? Commented Feb 14, 2021 at 8:28
  • I've added 2 images for clarification please check them. Snippets are working for js but not for py. Commented Feb 14, 2021 at 8:44
  • In VS Code, the auto-completion function of python code is provided by the extension pyhon and language service. At present, it supports more prompts of a single code instead of auto-completion of snippets. Commented Feb 15, 2021 at 2:52

2 Answers 2

17

Found the answer:

It seems they decided to remove code snippets from the python extension in the last update: changelog in vscode

They may be added back in the future but for now i would suggest just using the python snippets extention: https://marketplace.visualstudio.com/items?itemName=frhtylcn.pythonsnippets

Sign up to request clarification or add additional context in comments.

1 Comment

If you want the exact old snippets because you're used to them (like I was) they can be found here and added to your user snippets.
-1
  1. Install the Python extension for VS Code from the Visual Studio Marketplace(Link)

  2. To verify that you've installed Python successfully on your machine, run one of the following commands (depending on your operating system):

Linux/macOS: open a Terminal Window and type the following command:

python3 --version

Windows: open a command prompt and run the following command:

py -3 --version
  1. From within VS Code, select a Python 3 interpreter by opening the Command Palette (Ctrl+Shift+P), start typing the Python: Select Interpreter command to search, then select the command. You can also use the Select Python Environment option on the Status Bar if available (it may already show a selected interpreter, too)

Refer to this article for more information

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.