Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Installation: What is file path to python.exe?

I am trying to schedule my python code (.py) to run in Windows 10 using task scheduler. In order to do so, I need to indicate where my python.exe file is located.

I downloaded the latest Anaconda to my Windows 10 machine and run my code in jupyter notebook successfully so I should have python.exe somewhere.

I cannot find where the "python.exe" file path is stored in my computer. Thoughts?

Please see sample example below:

enter image description here

like image 674
PineNuts0 Avatar asked Oct 28 '25 01:10

PineNuts0


1 Answers

You can get it quite easily using the os module:

First open a Python interpreter, not through terminal but directly (there should be a shortcut on your start menu).

Next get the os module:

import os

And use the getcwd() method to find it:

os.getcwd()

The better way to do it. If Python is added to path.

Open a command prompt window. Not the Python interpreter or open Power Shell and type:

where python

Another way to do it is to type python.exe in the file explorer search bar at C:.

like image 83
Xantium Avatar answered Oct 30 '25 16:10

Xantium