Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I wonder why python with homebrew doensn't work in VScode

I have installed python3 with homebrew, but it keeps making errors when i run. i think problem is that i'm not working at homebrew file, so i've searched but couldn't get solutions.

which python3

give me

/Library/Frameworks/Python.framework/Versions/3.9/bin/python3

and i'm using Python 3.9.9 64-bit interpreter in /opt/homebrew/bin/python3

How can i make my VScode work with homebrew python3enter image description here?

like image 204
함준하 Avatar asked Nov 20 '25 20:11

함준하


1 Answers

If you focus on the terminal you can probably press arrow up to see which command Visual Studio code used to run your program. It'll probably reveal the path of the python interpreter.

I used the answer from https://stackoverflow.com/a/51488832/467650 to make Visual Studio Code run with the desired python interpreter (which also for me was the homebrew one:

I pressed ⇧⌘P, found Python: Select Interpreter and entered the full path of the python executable. After that Visual Studio Code run just fine.

like image 104
Roy Solberg Avatar answered Nov 22 '25 10:11

Roy Solberg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!