0

I am using MacBook Air M1 macOS Ventura 13.4 (recently software updated) . I installed python for Mac and also VS code along with python extensions in VS code.

After writing a code and on pressing run, I am getting something like:

% /usr/bin/python3 /Users/tharigopulagowthamsree/Documents/gowtham/code/PIZZA.py xcode-select: note: No developer tools were found, requesting install. If developer tools are located at a non-default location on disk, use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog. See man xcode-select for more details.

And also a popup :

The "python3" command requires the command line developer tools. Would you like to install the tools now? Choose Install to download and install the command line developer tools now.

It was not necessary before. What should I do now? How can I fix these? Can't I run code without downloading the something which is asked for? What's it has been asked to download?

1
  • How did you install python and where is it?
    – mmmmmm
    Jun 4 at 10:37

1 Answer 1

0

MacOS comes with a 'stub' file at /usr/bin/python3. If Xcode, or the Xcode Command Line Tools, is not installed, then it asks you to do so, when it is run.

When Xcode is installed, python 3.9 is installed, and executing /usr/bin/python3 will launch this version of python.

i installed python for mac and also VS code along with python extensions in VS code .

These will be somewhere else, such as /usr/local/bin/

The problem seems to be that whatever method you used to call and run python3, it's pointing to Apple's python (which isn't installed), rather than the version of python that you have installed.

That suggests that $PATH isn't set up correctly; or possibly some other environmental variable for VS code.

1
  • 1
    I think the whole point of the question is that the $PATH is not correct. I think this is not really an answer but a long comment.
    – mmmmmm
    Jun 4 at 12:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .