Where is python installed on windows

How to Find Where Python is Installed on Windows?

Python supported various inbuilt and open-source modules. To use these modules and their functions, we need to import them at the start of the program. The Python interpreter will not import these modules if we don’t add a Python path to the window path. It is necessary to find the Python paths and map them to Windows otherwise; these modules can not be accessible in the Python program.

To find the Python path or where Python is installed on windows, various functions are used, such as using the “where python” command in the cmd terminal, using system properties, etc.

Читайте также:  Расширение для файлов html документ

This post provides multiple methods to find installed Python paths on windows:

  • Method 1: Using CMD Terminal
  • Method 2: Using the sys Library
  • Method 3: Using Windows Startup Menu
  • Method 4: Using System Properties

Method 1: Using CMD Terminal

The path of the installed Python can be found using the following command in cmd terminal:

Using where python

The easiest way to find where Python is installed on windows is using “where python” command in cmd terminal:

The above snippet shows the path of the installed Python.

Using py –list-paths

The “py –list-paths” command can be used as an alternative to getting the installation path of installed Python:

The path of the installed Python has been displayed successfully.

Method 2: Using the sys Library

The “sys” library interacts with the Python interpreter and runtime environment through various functions. The “sys.exec_prefix” is used to find the path of the installed Python:

import sys print(sys.exec_prefix)

The “sys” module is imported. The “sys.exec_prefix” is passed as an argument to print() function to show the installed Python path.

The installed Python path has been displayed.

Method 3: Using Windows Startup Menu

The third simple method to find where Python is installed on windows is using the startup menu search. To open a Python-installed path, you need to type “python.exe” in the search bar and click on the “open the file location” option.

The Python-installed path has been opened, and the “exe” file shows the installed Python.

Method 4: Using System Properties

The manual way of opening the installed Python path is done using the system properties of the system. But this method is only applicable if your Python path is added to the windows path at the time of installation or later. To add Python to the windows path, check this specific guide.

Now after adding the Python path to the window path, you can follow the below steps to get the Python installation path:

Step 1: Open the Run dialog box and type “sysdm.cpl” in the run dialog box:

Step 2: Select environment variables from the advanced option.

Step 3: Select the Python path and click on the “Edit” button.

Step 4: The path of all installed Python is located in the environment variable setting.

Conclusion

To find where Python is installed on windows, various methods such as CMD terminal, sys library, startup menu search, and system properties are used in Python. The “where python” and “py –list-paths” commands are used to get the installed Python path. Similarly, opening the file location of the “python.exe” file from the start menu search will also open the installed Python path. This post presented various methods to find where Python is installed on Windows.

Источник

How Can I Find Where Python is Installed on Windows

Python is one of the most well-known, all-purpose, and straightforward programming language that is used by a programmer all across the world. It can be utilized in many applications, projects, websites, and APIs. Sometimes, we need to check Python packages or modules from the path where Python is installed.

In this article, we will demonstrate methods to find the path where Python is installed on Windows:

Method 1: Find Where Python is Installed on Windows Using Command Prompt

To find out where Python is installed using Windows Command Prompt, follow the below-listed examples.

Example 1: Using “where” Command
First use the “where” command to print out the path of the Python installed directory:

As you can see, the output fetched the required path and displayed on Command Prompt:

Example 2: Execute py Command
The “py” command can also be utilized with the “–list-paths” option to list the Python path:

Let’s check out the second method.

Method 2: Find Where Python is Installed on Windows Using Startup Menu

To find where Python is installed using the “Startup” menu, follow the below-mentioned procedure.

First, search for “Python.exe” in the “Startup” menu. Then, select the “Open file location” option to open the related folder:

As a result, you will be navigated towards the directory where Python is installed:

Let’s check out the third method to find out the location of Python.

Method 3: Find Where Python is Installed on Windows Using Environment Variable Settings

To check out the location where the Python is installed using the PATH environment variable, follow the mentioned steps.

Step 1: Open Advanced System Settings

Press “Window+I” to open the system Settings. Then, select the “System” from the list of available categories:

Search for “Advanced system settings” in the search bar and open it:

Step 2: Open Environment Variables

After opening the System system, click on the “Environment Variables” button:

Step 3: Open Path Environment Variable
Under the “System Variables” tab, choose “Path” and press the “Edit” button to view the path details:

From the Path Environment Variable, you can find the location where the Python is installed as shown below:

We have compiled the different methods to find out where Python is installed on Windows.

Conclusion

There are many ways to find out where Python is installed such as using Command Prompt, Startup menu, and System Environment Variables. For the first approach, open the Command Prompt and utilize the “where python” command. In the second approach, search “python.exe” in the “Startup” menu and open the file location. In the third approach, you can find out Python location through the “Path” Environment Variable. We have illustrated the different methods to locate where Python is installed on Windows.

About the author

Rafia Zafar

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.

Источник

Как узнать, где установлен Python в Windows?

Иногда нам нужно проверить пакеты или модули в том месте, где установлен Python. В этой статье мы покажем три способа, как найти папку в которой установлен Python в Windows:

  • с помощью командной строки
  • через меню “Пуск
  • используя параметры переменной среды

Как найти место установки Python в Windows с помощью командной строки

Примечание редакции: о собственно установке Python читайте в статье “Как установить Python на Windows 10 или 11”.

Чтобы узнать, где установлен Python, используя командную строку Windows, следуйте приведенным ниже примерам.

Пример 1: команда where

Для начала попробуйте использовать команду where , чтобы вывести путь к директории установленного Python:

Как видите, в результате нужный путь был найден и отображен в командной строке:

Использование where в командной строке. На следующей строке после введенной команды выведен путь, по которому в Windows установлен Python

Пример 2: команда py

Команда py с опцией —list-paths также может быть использована для перечисления путей к Python:

Использование команды py --list-paths в командной строке

Как найти место установки Python в Windows с помощью меню “Пуск”

Чтобы найти, где установлен Python, используя меню “Пуск”, выполните следующую процедуру.

Сначала найдите файл “Python.exe” в меню “Пуск”. Затем выберите опцию “Открыть расположение файла”, чтобы открыть соответствующую папку:

Опция

В результате вы будете перемещены в каталог, где установлен Python:

Каталог, где установлен Python

Как найти место установки Python в Windows с помощью переменной окружения

Чтобы узнать, где установлен Python, используя переменную окружения PATH , выполните следующие действия.

Шаг 1. Откройте расширенные системные настройки

Нажмите Window+I , чтобы открыть Настройки системы. Затем выберите “Система” из списка доступных категорий:

Окно настроек

Найдите в строке поиска “Дополнительные параметры системы” и откройте их:

Дополнительные параметры системы

Шаг 2. Откройте переменные среды

В Дополнительных параметрах системы нажмите на кнопку “Переменные среды”:

Переменные среды

Шаг 3. Откройте переменную среды Path

На вкладке “Системные переменные” выберите “Path” и нажмите кнопку “Изменить” для просмотра сведений о пути:

Вкладка

Из переменной среды Path можно найти место, где установлен Python, как показано ниже:

Окно редактирования переменной окружения с выделенным путем к Python

Заключение

Узнать, где в Windows установлен Python, можно разными способами, например, с помощью командной строки, меню “Пуск” и системных переменных среды.

Для первого способа откройте командную строку и воспользуйтесь командой where python . Во втором случае найдите “python.exe” в меню “Пуск” и откройте местоположение файла. При третьем подходе вы можете узнать расположение Python через переменную среды “Path”.

Источник

Оцените статью