Github Desktop using different Visual Studio Code version from Anaconda

Question:

I have read over 20 posts of an error running the code in .py file, but I still cannot get it running. I got an error like

import requests Traceback (most recent call last): File "",
line 1, in ModuleNotFoundError: No module named ‘requests’

No version is set for command pip Consider adding one of the following
versions in your config file at python 3.8.13

pip install requests
File "", line 1
pip install requests
SyntaxError: invalid syntax

I want the visual studio code to run the .py file, I was able to run .ipynb just fine. However, I tried running the visual studio code on Anaconda, and, surprisingly, the code runs fine. Now, how to do I change the version of the visual studio code when I open it on the Github desktop to be the same as the anaconda one? I tried changing the interpreter, and it does not seem to work. The only solution now is to run VSC in anaconda.

Update 1: After several posts and google searches later, I found this post to work for me. In order for the change to kick in, I need to restart the VSC as well.

Update 2: I found out that pressing shift + enter to run the python code on mac will screw up the terminal in VSC. I need to kill that terminal and rerun using only run button on the top right of the UI.

Asked By: FastBoi

||

Answers:

Update 1: After several posts and google searches later, I found this post to work for me. In order for the change to kick in, I need to restart the VSC as well.

Update 2: I found out that pressing shift + enter to run the python code on mac will screw up the terminal in VSC. I need to kill that terminal and rerun using only run button on the top right of the UI.

Answered By: FastBoi