[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-24。"],[],[],null,["# Setup guide for Python\n\nThis page shows you how to set up your development environment to use MediaPipe\nTasks in your Python applications.\n\nSupported platforms and versions\n--------------------------------\n\nBuilding applications with MediaPipe Tasks requires the following development\nenvironment resources:\n\n- OS:\n - Desktop: Windows, Mac, Linux\n - IoT: Raspberry OS 64-bit\n- Python: version 3.9 - 3.12\n- PIP: version 20.3+\n\n| **Note:** If you are testing or experimenting with MediaPipe tasks, consider using [Colaboratory](https://colab.research.google.com/), a Python notebook environment that requires no setup and runs entirely in the cloud.\n\nDeveloper environment setup\n---------------------------\n\nBefore running a MediaPipe task on a Python application, install the MediaPipe\npackage. \n\n $ python -m pip install mediapipe\n\n| **Attention:** This MediaPipe Solutions Preview is an early release. [Learn more](/edge/mediapipe/solutions/about#notice).\n\nAfter installing the package, import it into your development project. \n\n import mediapipe as mp\n\nMediaPipe Tasks dependencies\n----------------------------\n\nMediaPipe Tasks provides three prebuilt libraries for vision, text, audio.\nDepending on the MediaPipe Task used by the app, import the vision, text, or\naudio library into your development project.\n\n### Vision tasks\n\nThe MediaPipe Tasks vision module contains tasks that handle image or video\ninputs. To import the MediaPipe Tasks vision library, import the following\ndependency to your into your development project. \n\n from mediapipe.tasks.python import vision\n\n### Text tasks\n\nThe MediaPipe Tasks text module contains tasks that handle string inputs.To\nimport the MediaPipe Tasks text library, import the following dependency to your\ninto your development project. \n\n from mediapipe.tasks.python import text\n\n### Audio tasks\n\nThe MediaPipe Tasks audio module contains tasks that handle sound inputs. To\nimport the MediaPipe Tasks audio library, import the following dependency to\nyour into your development project. \n\n from mediapipe.tasks.python import audio\n\nBaseOptions configuration\n-------------------------\n\nThe BaseOptions allow for general configuration of MediaPipe Task APIs.\n\n| Option name | Description | Accepted values |\n|----------------------|----------------------------------------------------------|--------------------------------|\n| `model_asset_buffer` | The model asset file contents. | Model content as a byte string |\n| `model_asset_path` | The path of the model asset to open and map into memory. | File path as a string |\n\nTroubleshooting\n---------------\n\nFor help with technical questions related to MediaPipe, visit the\n[discussion group](https://groups.google.com/forum/#!forum/mediapipe) or\n[Stack Overflow](https://stackoverflow.com/questions/tagged/mediapipe) for\nsupport from the community. To report bugs or make feature requests,\n[file an issue on GitHub](https://github.com/google/mediapipe/issues).\n\nFor help setting up your Python development environment, visit the\n[Python developer's guide](https://devguide.python.org/)."]]