xcode 没有这样的模块“CreateMLUI”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/50728349/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:40:10  来源:igfitidea点击:

No such module "CreateMLUI"

xcodexcode10macos-mojavecreatemlcreatemlui

提问by David Cruz

I am using macOS Mojave Beta (10.14 18A293u) and Xcode 10.0 Beta (10L176w). I created a Swift Playground and I am unable to import CreateMLUIframework in order to use it. I keep getting an import error.

我使用的是 macOS Mojave Beta (10.14 18A293u) 和 Xcode 10.0 Beta (10L176w)。我创建了一个 Swift Playground,但无法导入CreateMLUI框架以使用它。我不断收到导入错误。

Playground Screenshot

游乐场截图

I have tried creating both an iOS Playgroundand a macOS Playground

我曾尝试创建iOS PlaygroundmacOS Playground

Anyone knows what I am doing wrong?

有谁知道我做错了什么?

Thanks in advance.

提前致谢。

回答by David Cruz

While macOS Mojave and Xcode 10 are in beta you may experience bugs while trying to use CreateML.

当 macOS Mojave 和 Xcode 10 处于测试阶段时,您在尝试使用 CreateML 时可能会遇到错误。

@Koen from one of the comments in my question found a topic in Apple Developer Forums with some workarounds. What I did was:

@Koen 在我的问题中的一条评论中找到了 Apple Developer Forums 中的一个主题,并提供了一些解决方法。我所做的是:

  1. Create a new single view Mac OS (NOT iOS)playground
  2. Use a completely different name if already created a buggy playground (this is important)
  3. Add the import CreateMLUIline
  4. Remove all the other boilerplate code
  1. 创建一个新的单一视图Mac OS(不是 iOS)游乐场
  2. 如果已经创建了一个有缺陷的游乐场,请使用完全不同的名称(这很重要)
  3. 添加import CreateMLUI
  4. 删除所有其他样板代码

回答by infinite369

I found the answer to this problem in the apple developers forum (Can't find the exact link to the post). You simply have to select the macOS tab when creating a playground.

我在苹果开发者论坛中找到了这个问题的答案(找不到帖子的确切链接)。您只需在创建 Playground 时选择 macOS 选项卡。