You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode引入TesseractOCR模块报错:No such module 'TesseractOCR'

Hey there, let’s fix that "No such module 'TesseractOCR'" error you’re hitting in Xcode. I’ve troubleshooted this exact issue dozens of times, so here are the most reliable fixes to try:

Fixes for "No such module 'TesseractOCR'" in Xcode
  • Double-check your installation & workspace setup
    If you used CocoaPods:

    • Ensure you ran pod install after adding pod 'TesseractOCRiOS' to your Podfile. The biggest mistake here is opening the .xcodeproj file instead of the generated .xcworkspace—always use the workspace when working with pods!
    • If the workspace still isn’t working, close Xcode entirely, delete the Pods folder and Podfile.lock, re-run pod install, then reopen the workspace.

    If you used Swift Package Manager:

    • Head to your project settings > Swift Packages, and confirm TesseractOCR is listed with a resolved version. If not, remove the package and re-add it using the repo URL: https://github.com/gali8/Tesseract-OCR-iOS.
  • Verify framework inclusion in your target

    • For manual installations: Go to your target’s General tab > Frameworks, Libraries, and Embedded Content. Make sure TesseractOCR’s framework is listed, and set its embedding status to "Embed & Sign" (or "Embed Without Signing" if that fits your project’s signing setup).
    • For CocoaPods users: Check your Podfile to ensure the pod is assigned to the correct target (critical if you have multiple targets in your project). Example:
      target 'YourMainAppTarget' do
        pod 'TesseractOCRiOS'
      end
      
  • Clean Xcode’s build artifacts

    • Xcode’s cached data often causes module issues. First, clean the build folder with Cmd+Shift+K. Then delete your project’s Derived Data: Go to Xcode > Preferences > Locations > click the arrow next to Derived Data, find your project’s folder, and delete it. Restart Xcode and rebuild.
  • Check build settings for path issues

    • Go to your target > Build Settings > search for "Framework Search Paths". If you installed the framework manually, confirm the path to TesseractOCR’s framework is added here (use a relative path like $(PROJECT_DIR)/Frameworks if possible). For package manager installs, this should be auto-configured, but a clean rebuild can fix any glitches here.
  • Confirm version compatibility

    • Make sure the TesseractOCR version you’re using matches your Xcode and iOS deployment target. Newer versions may require Xcode 14+ or iOS 13+, so check the library’s README for compatibility notes if you’re on an older setup.

内容的提问来源于stack exchange,提问作者David Kramf

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:13:33