【问题标题】:import tensorflow error using sublime text 3使用 sublime text 3 导入 tensorflow 错误
【发布时间】:2017-04-09 07:19:21
【问题描述】:

当我在 macOS 10.12 上使用 sublime3 python3 导入 tensorflow 时,出现错误:

ImportError: 没有名为“pywraptensorflow”的模块

但是,我可以导入库并在终端中顺利运行我的脚本。为什么会出现这种情况?

我正在使用以下构建系统,python3 单独在 sublime 中运行良好。

    {
"cmd": ["/usr/local/Frameworks/Python.framework/Versions/3.5/bin/python3", "-u", "$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python"
}

谢谢!!

【问题讨论】:

  • 或许this?
  • 感谢您的链接!我找到了一个解决方案,任何人都有同样的问题:这是由于 sublime 没有使用终端的 bash 配置文件,我从终端启动 sublime 后,它可以工作。

标签: macos python-3.x tensorflow sublimetext3


【解决方案1】:

OP 自行解决了问题:当未从终端启动时,Sublime 不遵守 bash_profile 设置。解决方案:从终端窗口启动 sublime。

【讨论】:

    猜你喜欢
    • 2016-06-28
    • 1970-01-01
    • 2015-05-11
    • 2019-06-30
    • 1970-01-01
    • 1970-01-01
    • 2014-08-09
    • 2022-08-12
    • 2018-02-23
    相关资源
    最近更新 更多