OrbbecSDK V2 Python Wrapper
English · 中文
  • 1. Overview
    • 1.1. Introduction
      • 1.1.1. Device Support Comparison
      • 1.1.2. Supported Platforms
      • 1.1.3. Support Hardware Products
        • 1.1.3.1. v2-main Branch
        • 1.1.3.2. main Branch (v1.x)
    • 1.2. Orbbec SDK Overview
      • 1.2.1. Terms
      • 1.2.2. Orbbec SDK v2 Architecture Overview
      • 1.2.3. SDK Concept Overview
      • 1.2.4. SDK Programming Model
  • 2. Installation
    • 2.1. Virtual Environment Installation Guide
      • 2.1.1. 📋 Table of Contents
      • 2.1.2. 📊 Tool Selection Guide
      • 2.1.3. Quick Start
        • 2.1.3.1. Linux / macOS (venv)
        • 2.1.3.2. Windows (venv)
      • 2.1.4. 1. Using venv (Recommended for Beginners)
        • 2.1.4.1. 1.1 Check Python Version
        • 2.1.4.2. 1.2 Create Virtual Environment
        • 2.1.4.3. 1.3 Activate Virtual Environment
        • 2.1.4.4. 1.4 Install pyorbbecsdk2
        • 2.1.4.5. 1.5 Verify Installation
        • 2.1.4.6. 1.6 Run Examples
        • 2.1.4.7. 1.7 Deactivate Virtual Environment
      • 2.1.5. 2. Using pyenv (Multiple Python Versions)
        • 2.1.5.1. 2.1 Install pyenv
        • 2.1.5.2. 2.2 Install Python 3.10
        • 2.1.5.3. 2.3 Set Local Python Version in Project Directory
        • 2.1.5.4. 2.4 Create Virtual Environment and Activate
        • 2.1.5.5. 2.5 Install pyorbbecsdk2
        • 2.1.5.6. 2.6 Complete Workflow Example
      • 2.1.6. 3. Using conda (Data Science Users)
        • 2.1.6.1. 3.1 Install Miniconda
        • 2.1.6.2. 3.2 Create conda Environment
        • 2.1.6.3. 3.3 Install Dependencies (Optional)
        • 2.1.6.4. 3.4 Install pyorbbecsdk2
        • 2.1.6.5. 3.5 Exit Environment
        • 2.1.6.6. 3.6 Remove Environment (if needed)
      • 2.1.7. Platform-Specific Notes
        • 2.1.7.1. Linux
          • 2.1.7.1.1. Ubuntu/Debian
        • 2.1.7.2. macOS
          • 2.1.7.2.1. Xcode Command Line Tools
          • 2.1.7.2.2. Permission Issues
        • 2.1.7.3. Windows
          • 2.1.7.3.1. Visual C++ Redistributable
          • 2.1.7.3.2. PowerShell Execution Policy
      • 2.1.8. Troubleshooting
        • 2.1.8.1. ❌ “externally-managed-environment” Error
        • 2.1.8.2. ❌ “No module named ‘venv’”
        • 2.1.8.3. ❌ Virtual Environment Activated but Still Using System Python
        • 2.1.8.4. ❌ pip install Shows Permission Denied
        • 2.1.8.5. ❌ “pyorbbec_env/bin/activate: No such file”
      • 2.1.9. 📝 Best Practices
      • 2.1.10. 🔗 Related Documentation
    • 2.2. Environment Setup (One-Time Configuration)
      • 2.2.1. Quick Setup (Recommended)
        • 2.2.1.1. From Repository
          • 2.2.1.1.1. Windows (PowerShell)
          • 2.2.1.1.2. Linux
          • 2.2.1.1.3. macOS
        • 2.2.1.2. From Installed Package
        • 2.2.1.3. Command Options
      • 2.2.2. What This Setup Does
        • 2.2.2.1. Windows
        • 2.2.2.2. Linux
        • 2.2.2.3. macOS
      • 2.2.3. Manual Configuration (Advanced)
        • 2.2.3.1. Linux - Manual udev Rules Installation
        • 2.2.3.2. Windows - Manual Metadata Registration
    • 2.3. Installation Guide
      • 2.3.1. 📋 System Requirements
        • 2.3.1.1. Hardware Requirements
      • 2.3.2. 📖 Detailed Installation
        • 2.3.2.1. Prerequisites
        • 2.3.2.2. Python Version Check
        • 2.3.2.3. Virtual Environment (Recommended)
        • 2.3.2.4. Environment Setup (One-Time)
        • 2.3.2.5. System-Specific Prerequisites
        • 2.3.2.6. Installation Methods
        • 2.3.2.7. Method 1: pip install (Recommended)
        • 2.3.2.8. Method 2: Offline Wheel Installation
          • 2.3.2.8.1. Step 1: Download the Wheel
          • 2.3.2.8.2. Step 2: Install the Wheel
        • 2.3.2.9. “Hello World” Example
        • 2.3.2.10. Run an Example
      • 2.3.3. 🚀 Quick Install (TL;DR)
      • 2.3.4. 🐛 Troubleshooting
        • 2.3.4.1. “No device found” (Linux)
        • 2.3.4.2. Permission denied (macOS)
        • 2.3.4.3. ImportError on Windows
        • 2.3.4.4. Metadata/Timestamp Issues (Windows)
        • 2.3.4.5. Python Version Mismatch
        • 2.3.4.6. Offline Installation Fails
        • 2.3.4.7. Examples Not Running
      • 2.3.5. 📚 Next Steps
        • 2.3.5.1. Common Example Commands
      • 2.3.6. 📖 Additional Resources
  • 3. QuickStarts
    • 3.1. QuickStart Guide
    • 3.2. 🎯 Overview
      • 3.2.1. What You’ll Learn
      • 3.2.2. Time to Complete
      • 3.2.3. Final Result
    • 3.3. ✅ Prerequisites
      • 3.3.1. Hardware
      • 3.3.2. Software
      • 3.3.3. Quick Verification
      • 3.3.4. Platform-Specific Notes
    • 3.4. 🚀 Your First Application
      • 3.4.1. Step 1: Run the Quick Start Example
      • 3.4.2. Step 2: How It Works
      • 3.4.3. Step 3: Common Customizations
        • 3.4.3.1. Custom Resolution/FPS
        • 3.4.3.2. Color-Only Mode
        • 3.4.3.3. Save Frames to Disk
    • 3.5. 🐛 Troubleshooting
      • 3.5.1. “No device found” (Linux)
      • 3.5.2. Permission denied (macOS)
      • 3.5.3. Import Error
      • 3.5.4. Empty Frames
      • 3.5.5. Display Issues
      • 3.5.6. Metadata/Timestamp Issues (Windows)
    • 3.6. 📚 Next Steps
      • 3.6.1. 🗺️ Recommended Learning Path
      • 3.6.2. 🎓 Learn by Example
      • 3.6.3. Level 1 — Beginner ⭐
      • 3.6.4. Level 2 — Advanced ⭐⭐
      • 3.6.5. Level 3 — Applications ⭐⭐⭐
      • 3.6.6. Specialized — LiDAR ⭐⭐⭐
      • 3.6.7. 🔗 Additional Resources
      • 3.6.8. 📝 SDK Feature Overview
    • 3.7. 💡 Tips for Success
  • 4. Package
    • 4.1. Build from Source with UV (Recommended)
      • 4.1.1. Prerequisites
        • 4.1.1.1. All Platforms
        • 4.1.1.2. Platform-Specific Requirements
          • 4.1.1.2.1. Linux
          • 4.1.1.2.2. macOS
          • 4.1.1.2.3. Windows
      • 4.1.2. Build Scripts
      • 4.1.3. Quick Start
        • 4.1.3.1. Linux
        • 4.1.3.2. macOS
        • 4.1.3.3. Windows
      • 4.1.4. Script Options
        • 4.1.4.1. Examples
      • 4.1.5. Offline Build
        • 4.1.5.1. Prepare the cache online
        • 4.1.5.2. Default offline build
        • 4.1.5.3. Reuse an active environment
      • 4.1.6. Build Output
        • 4.1.6.1. Installing the Wheel
        • 4.1.6.2. Generate Type Stubs (Optional but Recommended)
      • 4.1.7. Build Process Details
        • 4.1.7.1. Key Differences by Platform
      • 4.1.8. Troubleshooting
        • 4.1.8.1. Common Issues
          • 4.1.8.1.1. “uv: command not found”
          • 4.1.8.1.2. “CMake configuration failed”
          • 4.1.8.1.3. “pybind11 not found” (Offline mode)
          • 4.1.8.1.4. “Permission denied” on macOS
          • 4.1.8.1.5. Build fails on Windows with “Visual Studio not found”
        • 4.1.8.2. Cleaning Build Artifacts
      • 4.1.9. Advanced Usage
        • 4.1.9.1. Customizing Python Versions
        • 4.1.9.2. Parallel Builds
        • 4.1.9.3. Environment Variables
      • 4.1.10. Comparison with Traditional Build
      • 4.1.11. Next Steps
      • 4.1.12. See Also
    • 4.2. Build from Source (Traditional CMake Method - Deprecated)
      • 4.2.1. Environment
        • 4.2.1.1. Compilation Platform Requirements
        • 4.2.1.2. Python Version
      • 4.2.2. Linux Python SDK Compilation
        • 4.2.2.1. Install Dependencies (Ubuntu)
        • 4.2.2.2. Custom Python Path (Optional)
        • 4.2.2.3. Build the Project
        • 4.2.2.4. Run the Examples
        • 4.2.2.5. Generate Python Stubs
        • 4.2.2.6. Making a Python Wheel
      • 4.2.3. Windows Python SDK Compilation
        • 4.2.3.1. Download the Python SDK Source Code
        • 4.2.3.2. Install Dependencies
        • 4.2.3.3. Configure Visual Studio Project
        • 4.2.3.4. Compile the Python SDK
        • 4.2.3.5. Test Examples
  • 5. Application Guide
    • 5.1. Create Device
    • 5.2. Create Pipeline
    • 5.3. Obtain the Sensor List
    • 5.4. Obtain Video Data Streams
      • 5.4.1. Blocking Polling Mode (Video Data Streams)
      • 5.4.2. Asynchronous Callback Mode (Video Data Streams)
    • 5.5. Obtain Imu Data Streams
      • 5.5.1. Blocking Polling Mode (Imu Data Streams)
      • 5.5.2. Asynchronous Callback Mode (Imu Data Streams)
    • 5.6. Obtain the Camera Intrinsic and Extrinsic Parameters
    • 5.7. Frame Aggregate
    • 5.8. D2C
      • 5.8.1. Hardware D2C
      • 5.8.2. Software D2C
    • 5.9. Software C2D
    • 5.10. Depth Point Cloud
    • 5.11. RGBD Point Cloud
    • 5.12. Noise Removeal Filter
      • 5.12.1. Hardware Noise Removeal Filter
      • 5.12.2. Software Noise Removeal Filter
    • 5.13. Depth Post-Processing Filters
    • 5.14. Recording and Playback
      • 5.14.1. Recording
      • 5.14.2. Playback
    • 5.15. Firmware Update
    • 5.16. Update Preset
    • 5.17. Device Disconnection and Reconnection
    • 5.18. Commonly Used Interfaces
      • 5.18.1. Device Reboot
      • 5.18.2. Obtain the Serial Number
      • 5.18.3. Obtain the IP Config
      • 5.18.4. Obtain Local Network Configuration
      • 5.18.5. IP Configuration
        • 5.18.5.1. Set IP Configuration (Persistent)
        • 5.18.5.2. Force IP Configuration (Temporary)
      • 5.18.6. Obtain Device Temperature
      • 5.18.7. Obtain Device Baseline
      • 5.18.8. Structured Data Read/Write
      • 5.18.9. Device Binary Data
      • 5.18.10. Stream Profile
      • 5.18.11. Obtain IMU StreamProfile
      • 5.18.12. Obtain Intrinsic and Extrinsic Parameters
      • 5.18.13. Obtain IMU Intrinsic Parameters
      • 5.18.14. LDP Switch
      • 5.18.15. HDR Merge
      • 5.18.16. Obtain LDP Measurement Value
      • 5.18.17. Obtain LDP Protection Status
      • 5.18.18. Laser Switch
      • 5.18.19. Obtain MetaData
      • 5.18.20. Triggered Capture
        • 5.18.20.1. Software Triggered Capture
        • 5.18.20.2. Timed Capture
      • 5.18.21. Timestamp Reset
      • 5.18.22. Device Time Synchronization
      • 5.18.23. D2D (Disparity to depth)
        • 5.18.23.1. Hardware D2D
        • 5.18.23.2. Software D2D
      • 5.18.24. Depth Settings
        • 5.18.24.1. Depth Working Mode
        • 5.18.24.2. Preset Configuration
        • 5.18.24.3. Set Depth AE
        • 5.18.24.4. Set Depth Exposure
        • 5.18.24.5. Set Depth Gain
        • 5.18.24.6. Set Depth Mirror
        • 5.18.24.7. Set Depth Flip
        • 5.18.24.8. Set Depth Rotation
        • 5.18.24.9. Set the Unit of Depth
        • 5.18.24.10. Set Min and Max Depth
      • 5.18.25. IR Parameter Settings
        • 5.18.25.1. Set IR AE
        • 5.18.25.2. Set IR Exposure
        • 5.18.25.3. Set IR Gain
        • 5.18.25.4. Set IR Target Brightness
        • 5.18.25.5. Set IR Maximum Exposure Value
        • 5.18.25.6. set IR Mirror
        • 5.18.25.7. Set IR Flip
        • 5.18.25.8. Set IR Rotation
      • 5.18.26. Color Parameter Settings
        • 5.18.26.1. Set Color AE
        • 5.18.26.2. Set Color Exposure
        • 5.18.26.3. Set Color Gain
        • 5.18.26.4. set Color Mirror
        • 5.18.26.5. Set Color Flip
        • 5.18.26.6. Set Color Rotation
        • 5.18.26.7. Set Color Automatic White Balance (AWB)
        • 5.18.26.8. Set Color White Balance Parameters
        • 5.18.26.9. Set the Color Brightness
        • 5.18.26.10. Set Color Sharpness
        • 5.18.26.11. Set Color Gamma
        • 5.18.26.12. Set Color Saturation
        • 5.18.26.13. Set Color Hue
        • 5.18.26.14. Set Color Auto Exposure Priority
        • 5.18.26.15. Set Color Backlight Compensation
        • 5.18.26.16. Set Color Contrast
        • 5.18.26.17. Set Color Power Line Frequency
      • 5.18.27. Multi-Camera Synchronization
        • 5.18.27.1. Multi-Camera Synchronous Hardware Connection
        • 5.18.27.2. Multi-Camera Synchronization Software Configuration
      • 5.18.28. Frame Interleave
        • 5.18.28.1. Load Frame Interleave
        • 5.18.28.2. Check Frame Interleave Support
      • 5.18.29. Heart Beat Control
      • 5.18.30. Log Management
        • 5.18.30.1. Set the log level
        • 5.18.30.2. Set the Log Output to the Console
        • 5.18.30.3. Set Log Output to File
        • 5.18.30.4. Set the Log Callback Output
    • 5.19. Structured Data Read/Write
      • 5.19.1. Choose the simplest interface
      • 5.19.2. Interface at a glance
      • 5.19.3. Basic usage
      • 5.19.4. Payload rules
      • 5.19.5. Check support and permission
      • 5.19.6. Read-only data
      • 5.19.7. Read, modify, verify and restore
      • 5.19.8. Supported properties
      • 5.19.9. Existing APIs and special cases
        • 5.19.9.1. Multi-device synchronization
        • 5.19.9.2. Depth work mode
        • 5.19.9.3. Device error state
        • 5.19.9.4. Variable and unavailable layouts
        • 5.19.9.5. IP configuration and other field conventions
      • 5.19.10. Type aliases
      • 5.19.11. Limitations
    • 5.20. Device Binary Data
      • 5.20.1. Protocol request and response
      • 5.20.2. Customer data storage
      • 5.20.3. Firmware update from bytes
      • 5.20.4. Input validation and errors
  • 6. API Reference
    • 6.1. Core
      • 6.1.1. Classes
        • 6.1.1.1. Context
          • Context
        • 6.1.1.2. Device
          • Device
        • 6.1.1.3. DeviceInfo
          • DeviceInfo
        • 6.1.1.4. DeviceList
          • DeviceList
        • 6.1.1.5. DevicePresetList
          • DevicePresetList
        • 6.1.1.6. Sensor
          • Sensor
        • 6.1.1.7. SensorList
          • SensorList
        • 6.1.1.8. CameraParamList
          • CameraParamList
        • 6.1.1.9. PresetResolutionConfigList
          • PresetResolutionConfigList
        • 6.1.1.10. OBDepthWorkModeList
          • OBDepthWorkModeList
        • 6.1.1.11. ColorPresetList
          • ColorPresetList
        • 6.1.1.12. DeviceFrameInterleaveList
          • DeviceFrameInterleaveList
        • 6.1.1.13. ApplicationConfig
          • ApplicationConfig
        • 6.1.1.14. ApplicationSensorConfig
          • ApplicationSensorConfig
        • 6.1.1.15. ApplicationDevDecimationConfig
          • ApplicationDevDecimationConfig
        • 6.1.1.16. ApplicationHDRMergeConfig
          • ApplicationHDRMergeConfig
        • 6.1.1.17. ApplicationPointCloudConfig
          • ApplicationPointCloudConfig
      • 6.1.2. Device Data Interface Details
    • 6.2. Pipeline
      • 6.2.1. Classes
        • 6.2.1.1. Pipeline
          • Pipeline
        • 6.2.1.2. Config
          • Config
    • 6.3. Frames
      • 6.3.1. Class Hierarchy
      • 6.3.2. Inheritance Overview
      • 6.3.3. Classes
        • 6.3.3.1. Frame
          • Frame
        • 6.3.3.2. VideoFrame
          • VideoFrame
        • 6.3.3.3. ColorFrame
          • ColorFrame
        • 6.3.3.4. DepthFrame
          • DepthFrame
        • 6.3.3.5. IRFrame
          • IRFrame
        • 6.3.3.6. ConfidenceFrame
          • ConfidenceFrame
        • 6.3.3.7. PointsFrame
          • PointsFrame
        • 6.3.3.8. LiDARPointsFrame
          • LiDARPointsFrame
        • 6.3.3.9. AccelFrame
          • AccelFrame
        • 6.3.3.10. GyroFrame
          • GyroFrame
        • 6.3.3.11. FrameSet
          • FrameSet
      • 6.3.4. Enumerations
        • 6.3.4.1. OBFrameType
          • pyorbbecsdk.OBFrameType
        • 6.3.4.2. OBFrameMetadataType
          • pyorbbecsdk.OBFrameMetadataType
        • 6.3.4.3. OBFormat
          • pyorbbecsdk.OBFormat
        • 6.3.4.4. OBMediaType
          • pyorbbecsdk.OBMediaType
        • 6.3.4.5. OBMediaState
          • pyorbbecsdk.OBMediaState
        • 6.3.4.6. OBPlaybackStatus
          • pyorbbecsdk.OBPlaybackStatus
      • 6.3.5. Constants
        • UNKNOWN
        • PAUSED
        • PLAYING
        • STOPPED
        • COUNT
    • 6.4. Stream Profile
      • 6.4.1. Class Hierarchy
      • 6.4.2. Inheritance Overview
      • 6.4.3. Classes
        • 6.4.3.1. StreamProfile
          • StreamProfile
        • 6.4.3.2. VideoStreamProfile
          • VideoStreamProfile
        • 6.4.3.3. AccelStreamProfile
          • AccelStreamProfile
        • 6.4.3.4. GyroStreamProfile
          • GyroStreamProfile
        • 6.4.3.5. LiDARStreamProfile
          • LiDARStreamProfile
        • 6.4.3.6. StreamProfileList
          • StreamProfileList
        • 6.4.3.7. OBDepthWorkMode
          • OBDepthWorkMode
        • 6.4.3.8. OBPresetResolutionConfig
          • OBPresetResolutionConfig
        • 6.4.3.9. OBHdrConfig
          • OBHdrConfig
      • 6.4.4. Enumerations
        • 6.4.4.1. OBSensorType
          • pyorbbecsdk.OBSensorType
        • 6.4.4.2. OBStreamType
          • pyorbbecsdk.OBStreamType
        • 6.4.4.3. OBDepthWorkModeList
        • 6.4.4.4. OBDepthWorkModeTag
          • pyorbbecsdk.OBDepthWorkModeTag
        • 6.4.4.5. OBAlignMode
          • pyorbbecsdk.OBAlignMode
        • 6.4.4.6. OBFrameAggregateOutputMode
          • pyorbbecsdk.OBFrameAggregateOutputMode
        • 6.4.4.7. OBCompressionMode
          • pyorbbecsdk.OBCompressionMode
        • 6.4.4.8. OBCompressionParams
        • 6.4.4.9. OBHardwareDecimationConfig
        • 6.4.4.10. OBSyncMode
          • pyorbbecsdk.OBSyncMode
        • 6.4.4.11. OBMultiDeviceSyncMode
          • pyorbbecsdk.OBMultiDeviceSyncMode
        • 6.4.4.12. OBGyroSampleRate
          • pyorbbecsdk.OBGyroSampleRate
      • 6.4.5. Constants
        • SAMPLE_RATE_UNKNOWN
        • SAMPLE_RATE_1_5625_HZ
        • SAMPLE_RATE_3_125_HZ
        • SAMPLE_RATE_6_25_HZ
        • SAMPLE_RATE_12_5_HZ
        • SAMPLE_RATE_25_HZ
        • SAMPLE_RATE_50_HZ
        • SAMPLE_RATE_100_HZ
        • SAMPLE_RATE_200_HZ
        • SAMPLE_RATE_400_HZ
        • SAMPLE_RATE_500_HZ
        • SAMPLE_RATE_1_KHZ
        • SAMPLE_RATE_2_KHZ
        • SAMPLE_RATE_4_KHZ
        • SAMPLE_RATE_8_KHZ
        • SAMPLE_RATE_16_KHZ
        • SAMPLE_RATE_32_KHZ
        • SAMPLE_RATE_800_HZ
    • 6.5. Filters
      • 6.5.1. Class Hierarchy
      • 6.5.2. Inheritance Overview
      • 6.5.3. Classes
        • 6.5.3.1. Filter
          • Filter
        • 6.5.3.2. AlignFilter
          • AlignFilter
        • 6.5.3.3. DecimationFilter
          • DecimationFilter
        • 6.5.3.4. DisparityTransform
          • DisparityTransform
        • 6.5.3.5. FormatConvertFilter
          • FormatConvertFilter
        • 6.5.3.6. HDRMergeFilter
          • HDRMergeFilter
        • 6.5.3.7. HoleFillingFilter
          • HoleFillingFilter
        • 6.5.3.8. NoiseRemovalFilter
          • NoiseRemovalFilter
        • 6.5.3.9. PointCloudFilter
          • PointCloudFilter
        • 6.5.3.10. SequenceIdFilter
          • SequenceIdFilter
        • 6.5.3.11. SpatialAdvancedFilter
          • SpatialAdvancedFilter
        • 6.5.3.12. TemporalFilter
          • TemporalFilter
        • 6.5.3.13. ThresholdFilter
          • ThresholdFilter
        • 6.5.3.14. EdgeNoiseRemovalFilter
          • EdgeNoiseRemovalFilter
        • 6.5.3.15. EnhancedDepthFilter
          • EnhancedDepthFilter
        • 6.5.3.16. FalsePositiveFilter
          • FalsePositiveFilter
        • 6.5.3.17. LutNoiseRemovalFilter
          • LutNoiseRemovalFilter
        • 6.5.3.18. MgcNoiseRemovalFilter
          • MgcNoiseRemovalFilter
        • 6.5.3.19. SpatialFastFilter
          • SpatialFastFilter
        • 6.5.3.20. SpatialModerateFilter
          • SpatialModerateFilter
        • 6.5.3.21. UnDistortionFilter
          • UnDistortionFilter
        • 6.5.3.22. FilterFactory
          • FilterFactory
      • 6.5.4. Enumerations
        • 6.5.4.1. OBFilterList
        • 6.5.4.2. OBFilterConfigSchemaItem
        • 6.5.4.3. OBFilterConfigValueType
          • pyorbbecsdk.OBFilterConfigValueType
        • 6.5.4.4. OBHoleFillingMode
          • pyorbbecsdk.OBHoleFillingMode
        • 6.5.4.5. OBNoiseRemovalFilterParams
        • 6.5.4.6. OBEdgeNoiseRemovalType
          • pyorbbecsdk.OBEdgeNoiseRemovalType
        • 6.5.4.7. OBEdgeNoiseRemovalFilterParams
        • 6.5.4.8. OBDDONoiseRemovalType
          • pyorbbecsdk.OBDDONoiseRemovalType
        • 6.5.4.9. OBSpatialAdvancedFilterParams
        • 6.5.4.10. OBLutNoiseRemovalFilterParams
        • 6.5.4.11. OBMgcNoiseRemovalFilterParams
        • 6.5.4.12. OBSpatialFastFilterParams
        • 6.5.4.13. OBSpatialModerateFilterParams
        • 6.5.4.14. OBConvertFormat
          • pyorbbecsdk.OBConvertFormat
    • 6.6. Record & Playback
      • 6.6.1. Classes
        • 6.6.1.1. RecordDevice
          • RecordDevice
        • 6.6.1.2. PlaybackDevice
          • PlaybackDevice
    • 6.7. Data Structures
      • 6.7.1. Classes
        • 6.7.1.1. OBDeviceSerialNumber
          • OBDeviceSerialNumber
        • 6.7.1.2. OBDispOffsetConfig
          • OBDispOffsetConfig
        • 6.7.1.3. OBDeviceTime
          • OBDeviceTime
        • 6.7.1.4. OBDeviceErrorState
          • OBDeviceErrorState
        • 6.7.1.5. OBVersionInfo
          • OBVersionInfo
        • 6.7.1.6. OBDepthWorkModeInternal
          • OBDepthWorkModeInternal
        • 6.7.1.7. OBImuPresetList
          • OBImuPresetList
        • 6.7.1.8. OBBaselineCalibrationParam
          • OBBaselineCalibrationParam
        • 6.7.1.9. OBDeviceTemperature
          • OBDeviceTemperature
        • 6.7.1.10. OBTofExposureThresholdControl
          • OBTofExposureThresholdControl
        • 6.7.1.11. OBDeviceSyncConfig
          • OBDeviceSyncConfig
        • 6.7.1.12. OBDeviceIpAddrConfig
          • OBDeviceIpAddrConfig
        • 6.7.1.13. OBNetIpConfigV2
          • OBNetIpConfigV2
        • 6.7.1.14. OBMultiDeviceSyncConfig
          • OBMultiDeviceSyncConfig
        • 6.7.1.15. OBAwbGainParams
          • OBAwbGainParams
        • 6.7.1.16. OBRegionOfInterest
          • OBRegionOfInterest
        • 6.7.1.17. OBRect
          • OBRect
      • 6.7.2. Enumerations
        • 6.7.2.1. OBLogLevel
          • pyorbbecsdk.OBLogLevel
        • 6.7.2.2. OBError
        • 6.7.2.3. OBException
          • pyorbbecsdk.OBException
        • 6.7.2.4. OBStatus
          • pyorbbecsdk.OBStatus
        • 6.7.2.5. OBPropertyID
          • pyorbbecsdk.OBPropertyID
        • 6.7.2.6. OBDeviceErrorCode
          • pyorbbecsdk.OBDeviceErrorCode
        • 6.7.2.7. OBCameraParam
        • 6.7.2.8. OBCameraIntrinsic
        • 6.7.2.9. OBCameraDistortion
        • 6.7.2.10. OBCameraDistortionModel
          • pyorbbecsdk.OBCameraDistortionModel
        • 6.7.2.11. OBExtrinsic
        • 6.7.2.12. OBCalibrationParam
        • 6.7.2.13. OBAccelIntrinsic
        • 6.7.2.14. OBGyroIntrinsic
        • 6.7.2.15. OBAccelFullScaleRange
          • pyorbbecsdk.OBAccelFullScaleRange
        • 6.7.2.16. OBGyroFullScaleRange
          • pyorbbecsdk.OBGyroFullScaleRange
        • 6.7.2.17. OBAccelValue
        • 6.7.2.18. OBGyroValue
        • 6.7.2.19. OBFloat3D
        • 6.7.2.20. OBPoint2f
        • 6.7.2.21. OBPoint3f
        • 6.7.2.22. OBLiDARPoint
        • 6.7.2.23. OBLiDARScanPoint
        • 6.7.2.24. OBLiDARSpherePoint
        • 6.7.2.25. OBLiDARScanRate
          • pyorbbecsdk.OBLiDARScanRate
        • 6.7.2.26. OBColorPoint
        • 6.7.2.27. OBPixelType
          • pyorbbecsdk.OBPixelType
        • 6.7.2.28. OBPowerLineFreqMode
          • pyorbbecsdk.OBPowerLineFreqMode
        • 6.7.2.29. OBDCPowerState
          • pyorbbecsdk.OBDCPowerState
        • 6.7.2.30. OBUSBPowerState
          • pyorbbecsdk.OBUSBPowerState
        • 6.7.2.31. OBCommunicationType
          • pyorbbecsdk.OBCommunicationType
        • 6.7.2.32. OBProtocolVersion
        • 6.7.2.33. OBCmdVersion
          • pyorbbecsdk.OBCmdVersion
        • 6.7.2.34. OBCoordinateSystemType
          • pyorbbecsdk.OBCoordinateSystemType
        • 6.7.2.35. OBRotateDegreeType
          • pyorbbecsdk.OBRotateDegreeType
        • 6.7.2.36. OBDepthPrecisionLevel
          • pyorbbecsdk.OBDepthPrecisionLevel
        • 6.7.2.37. OBDepthCroppingMode
          • pyorbbecsdk.OBDepthCroppingMode
        • 6.7.2.38. OBTofFilterRange
          • pyorbbecsdk.OBTofFilterRange
        • 6.7.2.39. OBSequenceIdItem
        • 6.7.2.40. OBUpgradeState
          • pyorbbecsdk.OBUpgradeState
        • 6.7.2.41. OBDataTranState
          • pyorbbecsdk.OBDataTranState
        • 6.7.2.42. OBFileTranState
          • pyorbbecsdk.OBFileTranState
        • 6.7.2.43. OBPropertyItem
        • 6.7.2.44. OBPropertyType
          • pyorbbecsdk.OBPropertyType
        • 6.7.2.45. OBFloatPropertyRange
        • 6.7.2.46. OBIntPropertyRange
        • 6.7.2.47. OBUint8PropertyRange
        • 6.7.2.48. OBUint16PropertyRange
        • 6.7.2.49. OBBoolPropertyRange
        • 6.7.2.50. OBErrorDetails
        • 6.7.2.51. OBPipelineStatus
        • 6.7.2.52. OBDeviceTimestampResetConfig
        • 6.7.2.53. OBClockType
          • pyorbbecsdk.OBClockType
        • 6.7.2.54. OBDeviceType
          • pyorbbecsdk.OBDeviceType
        • 6.7.2.55. OBDeviceAccessMode
          • pyorbbecsdk.OBDeviceAccessMode
        • 6.7.2.56. OBDeviceAccessState
          • pyorbbecsdk.OBDeviceAccessState
        • 6.7.2.57. OBDeviceDevelopmentMode
          • pyorbbecsdk.OBDeviceDevelopmentMode
        • 6.7.2.58. OBPermissionType
          • pyorbbecsdk.OBPermissionType
        • 6.7.2.59. OBCameraPerformanceMode
          • pyorbbecsdk.OBCameraPerformanceMode
        • 6.7.2.60. OBColorPreset
          • pyorbbecsdk.OBColorPreset
        • 6.7.2.61. OBGvcpPortScheme
          • pyorbbecsdk.OBGvcpPortScheme
        • 6.7.2.62. OBIntraCameraSyncReference
          • pyorbbecsdk.OBIntraCameraSyncReference
        • 6.7.2.63. OBIpSourceType
          • pyorbbecsdk.OBIpSourceType
        • 6.7.2.64. OBPipelineIssue
          • pyorbbecsdk.OBPipelineIssue
        • 6.7.2.65. OBUvcBackendType
          • pyorbbecsdk.OBUvcBackendType
      • 6.7.3. Type Aliases
    • 6.8. Utilities
      • 6.8.1. Functions
        • 6.8.1.1. get_version
          • get_version()
        • 6.8.1.2. get_version_major
          • get_version_major()
        • 6.8.1.3. get_version_minor
          • get_version_minor()
        • 6.8.1.4. get_version_patch
          • get_version_patch()
        • 6.8.1.5. get_version_stage
          • get_version_stage()
        • 6.8.1.6. is_video_sensor_type
          • is_video_sensor_type()
        • 6.8.1.7. is_video_stream_type
          • is_video_stream_type()
        • 6.8.1.8. convert_format_to_string
          • convert_format_to_string()
        • 6.8.1.9. convert_frame_type_to_string
          • convert_frame_type_to_string()
        • 6.8.1.10. convert_frame_type_to_sensor_type
          • convert_frame_type_to_sensor_type()
        • 6.8.1.11. convert_frame_type_to_stream_type
          • convert_frame_type_to_stream_type()
        • 6.8.1.12. convert_frame_metadata_type_to_string
          • convert_frame_metadata_type_to_string()
        • 6.8.1.13. convert_sensor_type_to_string
          • convert_sensor_type_to_string()
        • 6.8.1.14. convert_sensor_type_to_stream_type
          • convert_sensor_type_to_stream_type()
        • 6.8.1.15. convert_stream_type_to_string
          • convert_stream_type_to_string()
        • 6.8.1.16. convert_stream_type_to_sensor_type
          • convert_stream_type_to_sensor_type()
        • 6.8.1.17. convert_stream_type_to_frame_type
          • convert_stream_type_to_frame_type()
        • 6.8.1.18. convert_accel_full_scale_range_to_string
          • convert_accel_full_scale_range_to_string()
        • 6.8.1.19. convert_gyro_full_scale_range_to_string
          • convert_gyro_full_scale_range_to_string()
        • 6.8.1.20. convert_imu_sample_rate_to_string
          • convert_imu_sample_rate_to_string()
        • 6.8.1.21. convert_imu_sample_rate_to_value
          • convert_imu_sample_rate_to_value()
        • 6.8.1.22. convert_imu_sample_rate_value_to_type
          • convert_imu_sample_rate_value_to_type()
        • 6.8.1.23. convert_lidar_scan_rate_to_string
          • convert_lidar_scan_rate_to_string()
        • 6.8.1.24. save_point_cloud_to_ply
          • save_point_cloud_to_ply()
        • 6.8.1.25. save_lidar_point_cloud_to_ply
          • save_lidar_point_cloud_to_ply()
        • 6.8.1.26. transformation2dto2d
          • transformation2dto2d()
        • 6.8.1.27. transformation2dto3d
          • transformation2dto3d()
        • 6.8.1.28. transformation3dto2d
          • transformation3dto2d()
        • 6.8.1.29. transformation3dto3d
          • transformation3dto3d()
    • 6.9. Quick Links
    • 6.10. Module Overview
  • 7. FAQ
    • 7.1. Table of Contents
    • 7.2. Installation Issues
      • 7.2.1. No device found on Linux
      • 7.2.2. Permission denied on macOS
      • 7.2.3. ImportError on Windows
      • 7.2.4. Python version mismatch
      • 7.2.5. Offline installation fails
      • 7.2.6. Package name confusion
      • 7.2.7. Examples fail after installing pyorbbecsdk2 (v2.1.4 and later)
      • 7.2.8. Open3D and NumPy version compatibility
    • 7.3. Build Issues
      • 7.3.1. uv command not found
      • 7.3.2. CMake configuration failed
      • 7.3.3. pybind11 not found in offline mode
      • 7.3.4. Build fails on Windows with Visual Studio not found
    • 7.4. Runtime Issues
      • 7.4.1. Empty frames or frames is None
      • 7.4.2. Display issues with OpenCV
      • 7.4.3. Jetson Nano illegal instruction
      • 7.4.4. Import Error ModuleNotFoundError
    • 7.5. Platform-Specific Issues
      • 7.5.1. USB device access permission error on Linux
      • 7.5.2. Metadata or timestamp issues on Windows
      • 7.5.3. macOS camera and terminal authorization
    • 7.6. Camera and Streaming
      • 7.6.1. Frame synchronization failures
      • 7.6.2. Resolution or FPS configuration issues
    • 7.7. Configuration
      • 7.7.1. How to configure or disable SDK logging
    • 7.8. Firmware
      • 7.8.1. Firmware version mismatch
      • 7.8.2. How to update firmware
    • 7.9. Additional Resources
  • 8. License
OrbbecSDK V2 Python Wrapper
  • 4. Package
  • 4.1. Build from Source with UV (Recommended)
  • View page source

4.1. Build from Source with UV (Recommended)

This guide explains how to build pyorbbecsdk wheel packages using uv, a fast Python package manager and resolver. The UV-based build system provides significant advantages over traditional pip/venv workflows:

  • Fast dependency resolution: UV resolves dependencies 10-100x faster than pip

  • Automatic Python version management: UV can install and manage multiple Python versions

  • Automatic virtual environments: UV creates and manages isolated environments automatically

  • Offline support: Build without internet access using cached dependencies

  • Cross-platform: Unified build process across Linux, macOS, and Windows

  • Reproducible builds: Consistent environment setup across different machines

💡 Prefer traditional virtual environments?

If you prefer using standard venv, pyenv, or conda instead of UV, see the Virtual Environment Installation Guide for alternative setup instructions.

4.1.1. Prerequisites

4.1.1.1. All Platforms

  1. Install uv: Follow the official uv installation guide

    # Linux/macOS
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Windows PowerShell
    powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
    
  2. Verify uv installation:

    uv --version
    
  3. Install CMake (3.15.0 or higher):

    • Download from CMake official website

    • Or install via package manager

  4. Verify Build Environment:

    Before building, verify that the required compiler tools are installed:

    Linux/macOS

    # Check CMake version (requires 3.15.0+)
    cmake --version
    
    # Check GCC version (requires 7.4.0+)
    gcc --version
    g++ --version
    

    Windows

    # Check CMake version
    cmake --version
    
    # Check Visual Studio installation
    # Option 1: Using vswhere (if installed with VS)
    & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
    
    # Option 2: Check for cl.exe
    Get-Command cl.exe -ErrorAction SilentlyContinue
    

    CMake and Visual Studio Version Compatibility (Windows):

Visual Studio Version

Minimum CMake Version

Visual Studio 2019

3.15.0+

Visual Studio 2022

3.20.0+

Visual Studio 2026

4.2.0+

If any command fails, refer to the Platform-Specific Requirements section below.

  1. Clone the repository:

    git clone https://github.com/orbbec/pyorbbecsdk.git
    cd pyorbbecsdk
    git checkout v2-main
    

4.1.1.2. Platform-Specific Requirements

4.1.1.2.1. Linux

  • GCC 7.4.0 or higher

  • Python development headers

# Ubuntu/Debian
sudo apt-get update
sudo apt-get install python3-dev build-essential

# CentOS/RHEL/Fedora
sudo yum install python3-devel gcc-c++

4.1.1.2.2. macOS

  • Xcode Command Line Tools

  • Clang/Clang++ compiler

# Install Xcode Command Line Tools
xcode-select --install

4.1.1.2.3. Windows

  • Visual Studio 2019 or 2022 with C++ build tools

  • Windows SDK

4.1.2. Build Scripts

The project provides platform-specific UV build scripts:

Platform

Script

Linux

scripts/build_whl/build-whl-uv.sh

macOS

scripts/build_whl/build-whl-uv-macos.sh

Windows

scripts/build_whl/build-whl-uv.ps1

Note: These scripts are available in the feature/uv_cli branch. To use them, switch to that branch or copy the scripts to your working directory.

4.1.3. Quick Start

4.1.3.1. Linux

# Make the script executable
chmod +x scripts/build_whl/build-whl-uv.sh

# Build for Python 3.10 (default)
./scripts/build_whl/build-whl-uv.sh

# Build for specific Python version
./scripts/build_whl/build-whl-uv.sh 3.11

# Build for multiple Python versions
./scripts/build_whl/build-whl-uv.sh 3.9 3.10 3.11

# Build the all-version batch (3.8-3.13); pass 3.14 explicitly for Python 3.14
./scripts/build_whl/build-whl-uv.sh all

4.1.3.2. macOS

# Make the script executable
chmod +x scripts/build_whl/build-whl-uv-macos.sh

# Build for Python 3.10 (default)
./scripts/build_whl/build-whl-uv-macos.sh

# Build for specific Python version
./scripts/build_whl/build-whl-uv-macos.sh 3.11

# Build for multiple Python versions
./scripts/build_whl/build-whl-uv-macos.sh 3.9 3.10 3.11

# Build the all-version batch (3.8-3.13); pass 3.14 explicitly for Python 3.14
./scripts/build_whl/build-whl-uv-macos.sh all

4.1.3.3. Windows

# Build for Python 3.10 (default)
.\scripts\build_whl\build-whl-uv.ps1

# Note: The Windows script currently builds configured versions in the script
# Edit $PythonVersions array in the script to change target versions

4.1.4. Script Options

All build scripts support the following command-line options:

Option

Description

--offline

Enable offline mode (requires pre-cached dependencies)

--no-clean

Skip cleaning build directories before building

--clean

Clean build directories before building (default)

--clean-only

Only clean build artifacts, don’t build

-h, --help

Show help message

4.1.4.1. Examples

# Offline build for Python 3.10
./scripts/build_whl/build-whl-uv.sh --offline 3.10

# Clean and build all versions
./scripts/build_whl/build-whl-uv.sh --clean all

# Only clean build artifacts
./scripts/build_whl/build-whl-uv.sh --clean-only

# Build without cleaning (incremental build)
./scripts/build_whl/build-whl-uv.sh --no-clean 3.11

4.1.5. Offline Build

Offline builds require matching OS/architecture, locally available Python interpreters, the native compiler/CMake toolchain and SDK libraries, and a populated uv cache. Copying the repository or virtual environments alone is not sufficient.

4.1.5.1. Prepare the cache online

On a matching online machine, complete the actual build once for every required Python version and platform. This caches pybind11, the isolated wheel build dependencies, and the tools needed on Linux to repair wheels and adjust their platform tags (auditwheel and wheel). Do not use an editable install of the project to prepare a clean checkout: the package backend requires CMake output in install/lib first.

# Linux example; use the macOS or Windows script on those platforms.
./scripts/build_whl/build-whl-uv.sh 3.10
uv cache dir
uv python dir

Transfer the project, the cache printed by uv cache dir, and any required uv-managed Python installations to the offline machine. Preserve cache contents; do not run cache pruning before transfer. Provide the compiler, CMake and system libraries separately. Virtual environments are not generally relocatable; recreate them on the target or use a locally prepared environment with valid interpreter paths. Repeat preparation for Python 3.14 explicitly if needed; all covers only 3.8 through 3.13.

4.1.5.2. Default offline build

Set the cache and Python installation locations to the copied directories, then use the platform’s offline flag:

# Linux; replace these paths with the transferred cache/interpreter directories.
export UV_CACHE_DIR=/path/to/copied-uv-cache
export UV_PYTHON_INSTALL_DIR=/path/to/copied-uv-python
./scripts/build_whl/build-whl-uv.sh --offline 3.10
# macOS: ./scripts/build_whl/build-whl-uv-macos.sh --offline 3.10
# Windows PowerShell
$env:UV_CACHE_DIR = "C:\offline\uv-cache"
$env:UV_PYTHON_INSTALL_DIR = "C:\offline\uv-python"
.\scripts\build_whl\build-whl-uv.ps1 3.10 -Offline

The default mode deletes and recreates the per-version environment and installs only pinned pybind11 into it. Packaging dependencies are installed separately by uv build in an isolated build environment. The offline flag sets UV_OFFLINE=1; missing cached dependencies or interpreters cause failure rather than being supplied by a copied venv* directory.

4.1.5.3. Reuse an active environment

To retain a locally prepared environment, activate it and add the script’s --no-sync option (PowerShell: -NoSync). The active Python version must match the requested version, and pybind11 must already be installed in that environment. For offline packaging, the isolated build dependencies must still be available in the uv cache. For example:

source .venv/bin/activate
./scripts/build_whl/build-whl-uv.sh --offline --no-sync 3.10
# macOS: ./scripts/build_whl/build-whl-uv-macos.sh --offline --no-sync 3.10

This mode skips environment recreation and pinned pybind11 installation. It still performs CMake compilation and uv build, whose isolated build requirements must be cached. It is not a guarantee that an arbitrary copied environment can build offline.

4.1.6. Build Output

After successful build, wheel packages are located in:

pyorbbecsdk/
└── wheel/
    ├── pyorbbecsdk2-2.0.XX-cp38-cp38-linux_x86_64.whl
    ├── pyorbbecsdk2-2.0.XX-cp39-cp39-linux_x86_64.whl
    ├── pyorbbecsdk2-2.0.XX-cp310-cp310-linux_x86_64.whl
    ├── pyorbbecsdk2-2.0.XX-cp313-cp313-linux_x86_64.whl
    ├── pyorbbecsdk2-2.0.XX-cp314-cp314-linux_x86_64.whl
    └── ...

4.1.6.1. Installing the Wheel

Replace the example filename with your built wheel. For wrapper 2.1.4 and later, include [examples] to run the SDK examples; omit it for a core-only installation. Quote the entire argument so shell bracket expansion does not interfere.

# Install the wheel package
pip install "wheel/pyorbbecsdk2-2.1.4-cp310-cp310-linux_x86_64.whl[examples]"

# Verify installation
pip show pyorbbecsdk2 | grep Version

4.1.6.2. Generate Type Stubs (Optional but Recommended)

From the repository root, activate the environment containing the newly built SDK. Stub generation inspects that installed package; rebuild/install the SDK first when bindings change. Follow the same package layout as stubs/README.md:

python -m pip install pybind11-stubgen
python -m pybind11_stubgen pyorbbecsdk -o generated_stubs
python scripts/fix_pyi.py generated_stubs/pyorbbecsdk/pyorbbecsdk.pyi stubs/pyorbbecsdk.pyi
python scripts/fix_pyi.py generated_stubs/pyorbbecsdk/__init__.pyi stubs/__init__.pyi

If the environment has no pip, first activate the intended virtual environment. Replace .venv with your actual environment directory:

Platform / shell

Activation command

Linux / macOS

source .venv/bin/activate

Windows PowerShell

.\.venv\Scripts\Activate.ps1

Windows Command Prompt

.venv\Scripts\activate.bat

Verify the active interpreter, then let uv install the tool into that activated environment:

python -c "import sys; print(sys.executable)"
uv pip install pybind11-stubgen
python -m pybind11_stubgen pyorbbecsdk -o generated_stubs

Use the same activated environment for the repair and copy commands above and below. The platform-specific interpreter paths are .venv/bin/python on Linux/macOS and .venv\Scripts\python.exe on Windows; do not use the Linux path on Windows. Both package and extension stubs must be repaired and copied together:

from pathlib import Path
import shutil
import pyorbbecsdk

package_dir = Path(pyorbbecsdk.__file__).resolve().parent
for name in ("pyorbbecsdk.pyi", "__init__.pyi"):
    shutil.copy2(Path("stubs") / name, package_dir / name)
print(package_dir)

4.1.7. Build Process Details

The build scripts perform the following steps:

  1. Parse Arguments: Process command-line options and Python versions

  2. Architecture Detection: Detect system architecture (x86_64, arm64)

  3. Environment Setup: Configure library paths for the SDK

  4. Cleanup (optional): Remove previous build artifacts

  5. Per-Version Build:

    • Resolve Python interpreter using UV

    • Resolve pybind11 CMake directory

    • Configure with CMake (using appropriate compiler)

    • Build and install targets

    • Copy runtime files (examples, config, stubs)

    • Build wheel package using uv build

    • Repair wheel with auditwheel (Linux only)

  6. Final Cleanup: Remove temporary build directories

4.1.7.1. Key Differences by Platform

Feature

Linux

macOS

Windows

Compiler

GCC/G++

Clang/Clang++

MSVC

Library Path

LD_LIBRARY_PATH

DYLD_LIBRARY_PATH

PATH

Architecture

x86_64, arm64

arm64

x64

Wheel Repair

auditwheel

None needed

None needed

Deployment Target

-

macOS 11.0 (build target; tested on M2/macOS 13.2)

-

4.1.8. Troubleshooting

4.1.8.1. Common Issues

4.1.8.1.1. “uv: command not found”

Solution: Ensure uv is installed and in your PATH:

# Add to ~/.bashrc or ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"

4.1.8.1.2. “CMake configuration failed”

Solution: Verify CMake version and Python development headers:

# Check CMake version
cmake --version

# Install Python development headers (Linux)
sudo apt-get install python3-dev

4.1.8.1.3. “pybind11 not found” (Offline mode)

Solution: Follow Offline Build and choose the preparation steps that match the build mode:

  • Default mode: The script deletes and recreates venv<version>, then installs pinned pybind11 from the uv cache. Installing pybind11 into venv310 beforehand does not preserve it through this process or supply all missing cached dependencies. Prepare the complete cache, interpreters and toolchain as described above.

  • Reuse an environment: Activate a valid local environment with pybind11 already installed and a Python version matching the requested version, then pass --offline --no-sync (PowerShell: -Offline -NoSync). This skips environment recreation and pinned pybind11 installation; the isolated wheel build still requires cached build dependencies. Merely creating an environment without activating it and selecting this mode is insufficient.

4.1.8.1.4. “Permission denied” on macOS

Solution: Fix library permissions:

chmod +x scripts/build_whl/build-whl-uv-macos.sh

4.1.8.1.5. Build fails on Windows with “Visual Studio not found”

Solution: Ensure Visual Studio 2019 or 2022 with C++ tools is installed, or specify the generator explicitly:

# In the PowerShell script, modify the cmake command
cmake -G "Visual Studio 17 2022" -A x64 ...

4.1.8.2. Cleaning Build Artifacts

If you encounter persistent build issues, perform a full clean:

# Using the script
./scripts/build_whl/build-whl-uv.sh --clean-only

# Manual cleanup
rm -rf build build_* dist install wheel src/*.egg-info

4.1.9. Advanced Usage

4.1.9.1. Customizing Python Versions

Edit the build script to change default Python versions:

# In scripts/build_whl/build-whl-uv.sh, modify:
PYTHON_VERSIONS=("3.10" "3.11")  # Your desired versions

4.1.9.2. Parallel Builds

The scripts automatically use all available CPU cores:

  • Linux: make -j$(nproc)

  • macOS: make -j$(sysctl -n hw.ncpu)

  • Windows: cmake --build --parallel

4.1.9.3. Environment Variables

Variable

Description

UV_LINK_MODE

Set to copy for compatibility (default in scripts)

UV_OFFLINE

Set to 1 to enable offline mode

MACOSX_DEPLOYMENT_TARGET

Build deployment target (script sets 11.0; tested on M2/macOS 13.2)

4.1.10. Comparison with Traditional Build

Feature

Traditional (pip/venv)

UV Build

Python Installation

Manual

Automatic

Dependency Resolution

pip

UV (faster)

Virtual Environment

Manual

Automatic

Offline Support

Limited

Full support

Cross-Platform

Different commands

Unified scripts

Build Time

Slower

Faster

4.1.11. Next Steps

After building the wheel:

  1. Install the wheel: pip install wheel/*.whl

  2. Set up environment: Run scripts/env_setup/install_udev_rules.sh (Linux)

  3. Run examples: See examples/ directory for sample code

  4. Refer to registration script: See registration_script.md for device setup

4.1.12. See Also

  • Install the Package - Installing pre-built wheels

  • Build from Source - Traditional CMake build method

  • UV Documentation

Previous Next

© Copyright 2024, ORBBEC INC. www.orbbec.com.. Last updated on 2026-11-20 15:41:43.