0

as you see "python --version show python3.10.4

but the interpreter show python 3.7.3

enter image description here

how can i change the envirnment in vscode

2

3 Answers 3

0

If you click on the interpreter version being used by VSCode, you should be able to select different versions across your device.

Interpreter version

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

7 Comments

i have been try this before , still can not change envirroment to python 3.7 . because i want to run streamlit in vscode .
Anaconda Navigator open terminal can succeed to change the environments in terminal , but vscode can not .
@KKC Perhaps you could try to run it in a virtual environment.
@KKC Also since the interpreter version seems to be the desired one (3.7), you could just create an alias in your terminal to address the interpreter version, unless you want to run it on 3.10.
thanks a lot , how can it creata alias in your terminal to address the interpreter version,
|
0

Selecting the interpreter in VSCode:

https://code.visualstudio.com/docs/python/environments#_work-with-python-interpreters

To run streamlit in vscode: Open the launch.json file of your project. Copy the following:

{
    "configurations": [
        

        {
            "name": "Python:Streamlit",
            "type": "python",
            "request": "launch",
            "module": "streamlit",
            
            "args": [
                
                "run",
                "${file}"
            ]
        }
     ]
}

Comments

0

Adding the following line to your setting.json (crtl+shift+P "preferences: open settings(JSON)").

"terminal.integrated.env.osx": {
    "PATH": ""
}

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.