> For the complete documentation index, see [llms.txt](https://treasuremaster.gitbook.io/python-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://treasuremaster.gitbook.io/python-docs/moduli-standartnoi-biblioteki-1/sluzhby-sredy-vypolneniya-python/sys/sys.path.md).

# sys.path

#### sys.path

Список строк, определяющих путь поиска модулей Python. Инициализируется из переменной среды PYTHONPATH плюс значение по умолчанию, зависящее от установки.

При инициализации при запуске программы первый элемент этого списка, `path [0]`, является каталогом, содержащим сценарий, который использовался для вызова интерпретатора Python. Если каталог сценария недоступен (например, если интерпретатор вызывается в интерактивном режиме или если сценарий читается со стандартного ввода), `path [0]` - это пустая строка, которая направляет Python на поиск модулей в первую очередь в текущем каталоге. Обратите внимание, что каталог сценария вставлен перед записями, вставленными в результате PYTHONPATH.

Программа может изменять этот список в своих целях. В ***sys.path*** следует добавлять только строки и байты; все другие типы данных игнорируются во время импорта.

{% hint style="info" %}
См. также модуль [site](/python-docs/moduli-standartnoi-biblioteki-1/sluzhby-sredy-vypolneniya-python/site.md). В нем описывается, как использовать файлы .pth для расширения ***sys.path***.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://treasuremaster.gitbook.io/python-docs/moduli-standartnoi-biblioteki-1/sluzhby-sredy-vypolneniya-python/sys/sys.path.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
