Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Automatically attempt to find a Python executable on the current machine
| ResourceFunction["FindPythonExecutable"][] searches for a Python executable on the current machine and asks to install it with SystemInstall if not found. | |
| ResourceFunction["FindPythonExecutable"][{"Python",opts}] uses the options opts for the executable. | |
| ResourceFunction["FindPythonExecutable"][assoc] gets the executable specified by assoc. | |
| ResourceFunction["FindPythonExecutable"][ExternalSessionObject[…]] gets the executable corresponding to the given "Python" session. | |
| ResourceFunction["FindPythonExecutable"]["uuid"] finds a Python executable for the external evaluator corresponding to the given UUID. | 
Find a Python executable on the current system:
| In[1]:= | ![ResourceFunction["FindPythonExecutable"][]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/5789824d20ae7a4e.png) | 
| Out[1]= |  | 
Get the executable corresponding to an association:
| In[2]:= | ![ResourceFunction["FindPythonExecutable"][<|"Version" -> "3"|>]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/53e750e90952484b.png) | 
| Out[2]= |  | 
Use an ExternalSessionObject:
| In[3]:= | ![session = StartExternalSession["Python"]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/35482b23767dcbc2.png) | 
| Out[3]= |  | 
| In[4]:= | ![ResourceFunction["FindPythonExecutable"][session]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/41d503a48cdc5c11.png) | 
| Out[4]= |  | 
Use a UUID:
| In[5]:= | ![ResourceFunction["FindPythonExecutable", ResourceVersion->"1.3.0"]["e333f5ef-f448-4e27-ba47-6d9cbab96a28"]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/7d1113c2542eaaed.png) | 
| Out[5]= |  | 
Validate a python executable path:
| In[6]:= | ![ResourceFunction["FindPythonExecutable"]["/usr/bin/python2"]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/6b0911f807f65d9f.png) | 
| Out[6]= |  | 
| In[7]:= | ![ResourceFunction["FindPythonExecutable"]["python3"]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/305117fb7b236c20.png) | 
| Out[7]= |  | 
| In[8]:= | ![ResourceFunction["FindPythonExecutable"]["/usr/bin/notpython"]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/210aadd555703c96.png) | 
| Out[8]= |  | 
| In[9]:= | ![ResourceFunction["FindPythonExecutable"]["/usr/bin/node"]](https://www.wolframcloud.com/obj/resourcesystem/images/1b6/1b673d7b-c89c-4b12-8dba-ff968389e94c/1-3-0/7c320cd6d5e2a7db.png) | 
| Out[9]= |  | 
This work is licensed under a Creative Commons Attribution 4.0 International License