【问题标题】:Conflicting Python versions in SageMaker Studio notebook with Python 3.8 kernelSageMaker Studio 笔记本中的 Python 版本与 Python 3.8 内核冲突
【发布时间】:2021-12-26 11:42:01
【问题描述】:

我正在尝试在 SageMaker Studio 中使用 Python 3.8 运行 SageMaker 内核,而笔记本似乎使用 Python 3.7 的单独发行版。 正在运行的应用程序表示为 tensorflow-2.6-cpu-py38-ubuntu20.04-v1。当我运行!python3 -V 时,我得到了Python 3.8.2。但是,笔记本里面的 Python 实例是不同的:

import sys
sys.version

'3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) \n[GCC 9.4.0]'

同样,运行 %pip -V%conda info 表示 Python 3.7。

另外,import tensorflow 失败,因为它没有预安装在笔记本调用的 Python 环境中。

我在 eu-west-2 地区跑步。我能做些什么来解决这个没有开支持票的问题吗?

【问题讨论】:

  • 我刚刚解决了这个问题,可以回答。你想要哪个 python 实例 - 3.8 或 conda 3.7?
  • 不确定,因为我不再从事这个项目。 @jtlz2 请分享什么对你有用。

标签: python-3.x amazon-web-services jupyter-notebook amazon-sagemaker anaconda3


【解决方案1】:

你还在面对这个问题吗?

我在 eu-west-2 中使用 SageMaker Studio 笔记本和 TensorFlow 2.6 Python 3.8 CPU 优化映像(正在运行的应用程序是 tensorflow-2.6-cpu-py38-ubuntu20.04-v1)。

当我运行以下命令时,我得到了正确的输出。

!python3 -V

返回 Python 3.8.2

import sys
sys.version 

返回 3.8.2(默认,2021 年 12 月 9 日,06:26:16)\n[GCC 9.3.0]'

import tensorflow as tf
print(tf.__version__)

返回 2.6.2

现在看来这个问题已经解决了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-07
    • 2017-07-26
    • 1970-01-01
    相关资源
    最近更新 更多