VSCode: There is no Pip installer available in the selected environment

前端 未结 14 1956
耶瑟儿~
耶瑟儿~ 2021-01-29 23:19

I\'m trying to run the autopep8 linter on a Python file in VSCode.

I\'ve followed the instructions here: https://code.visualstudio.com/docs/python/environments and selec

14条回答
  •  天涯浪人
    2021-01-30 00:06

    I have multiple python versions:

    2.7
    3.6
    3.7
    
    1. Tell the vscode/ visual studio code, which version to use:

    press the following (Show All Commands): Ctrl + Shift + P
    paste the following: Python: Select Interpreter
    Select one of the version that it shows, I have selected python 3.7.3 64-bit

    1. Update python path in settings:

    press Ctrl + , to open Settings
    search for python.pythonPath
    change python to /usr/bin/python3.7

    Note: this may not be needed, however, make sure /usr/bin/python3.7 really exists for you, you may have at a different path like /usr/local/bin/python3.7, etc.

    1. I had pip but it was 2.7, but since I am choosing python 3, it's pip needs to be installed

    Run the following command in Terminal: apt-get install python3-pip

    1. Restart vscode

    With the above steps, all issues got resolved. Hope that helps.

提交回复
热议问题