Question 3+ years old, but I've run into this multiple times and keep forgetting how I fixed it. So this is as much for me when I search for this next time!
The symptoms started this way for me:
I started my Mac over from scratch using macOS Monterey (12.2.1) and installed CodeRunner that I purchased via the App Store. I installed Anaconda 3.x too.
When I tried to run code within CodeRunner the first time, it asked me to install Python from python.org with the message "Python is not installed on your system."
I tried adding the path to my python binary in the same fashion as the OP. Mine was like $HOME/opt/anaconda3/bin/python3, but then I got the exact error as the OP ("To run your code, you need to have Python3 installed.")
I next forced the path to the Anaconda binary (like /Users/myname/opt/anaconda3/bin/python3), then I finally got the useful message "You may be experiencing errors caused by limitations of the App Store version of CodeRunner."
Assuming you have an App Store version:
- Go to the CodeRunner website (https://coderunnerapp.com) and download the latest version.
- Run it from the Downloads folder first (as opposed to replacing the one in your Applications folder) because the downloaded version must find the App Store version when you go through the "transfer your license" process.
- Go to "License..." in the CodeRunner menu.
- You'll see an option to use your App Store purchased version, then they'll email you a license key.
- Enter the license key they send you by email into the CodeRunner app you downloaded from their website.
- Quit CodeRunner and replace the CodeRunner in your Applications folder with the one you downloaded.
- Note if your binary (e.g., python3) is not under your home folder, or you are running code not located under your home directory, then you'll need to give CodeRunner access. I went the "Full Disk Access" route by dragging the CodeRunner icon into "Full Disk Access" in the Privacy tab of System Preferences:Security & Privacy.
After doing the above I was able to run my code without any errors or restrictions.