简体   繁体   中英

Why my VSCode's interpreter is not working in Mac?

I have VSCode and I am trying to set up a virtual environment. First, I created all the venv properly. When I run in the Terminal is working and activated. However, it is not showing up in the VSCode. Make the matter worse, I can not change my interpreter at all. At first, I had python 2.7 and I could not change into python3 even though everything is set up properly. I fixed that problem with this setting "code-runner.executorMap.python": "python3 -u" . And how I cannot change to another interpreter without the delete the setting. I am not sure what to do. Please help. Thanks

Others have reported setting up virtual environments using VSCode. I suggest you set up your virtual environment using the terminal and activating the environment before starting VSCode. If you are using Anaconda Python this source will instruct you on setting up a virtual environment. For non-anaconda python, there are many pages for doing the same

To change the interpreter in VSCode, go to the View menu and select the Command Palette. When the command palette opens type python in the text box. This will cause commands with python in its name to be displayed. The first command (on my machine) is Python: Select interpreter. Select this and hit return. You will be given a list of python interpreters to choose from.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM