skip to Main Content

I have Python 2.7 installed on my computer and have correctly configured the path in vscode, but Pylance still prompts that it cannot find the system functions.

enter image description here

enter image description here

Due to some necessary reasons, I cannot switch to Python 3.x.

If I switch to Python 3 in VSCode, the issue doesn’t occur. I am confident that my Python 2.7 is installed correctly, and the path configuration in VSCode is also accurate. How can I resolve this issue?

2

Answers


  1. The python extension no longer supports python 2.7 as of version 2021.10.

    What can I do if I’m still on Python 2.7?

    For auto-completion, you can turn off auto-completions, or select Pylance as your language server as it may provide a good experience if the code is compatible enough with Python 3. We will continue to support selecting Python 2.7 as an interpreter in your workspace. For tools that keep support for Python 2.7 in their actively maintained version, we will continue to support using them with Python 2.7.

    Login or Signup to reply.
  2. If you install an older version of Pylance as shown here, your problem will be solved.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search