python - 为什么 jupyter notebook 包在 aws sagemaker notebook 实例中不起作用?
问题描述
fig, axes = plt.subplots(2,figsize=(15,10))
sns.lineplot(agg_cases_death.index, agg_cases_death.cases, ax=axes[0]).set_title('Cases')
sns.lineplot(agg_cases_death.index, agg_cases_death.deaths, ax=axes[1]).set_title('Deaths')
plt.show()
以上曾经在我桌面上的 jupyter notebook 上完美运行,但是当我在 AWS Sagemaker Jupyter notebook 中运行相同的代码时,它会产生错误。它说模块“seaborn”没有属性线图。
在使用 aws sagemaker jupyter 时我们需要设置什么吗?
解决方案
众所周知,AWS Sagemaker 对此一窍不通。
尝试一下sns.__version__
,您会发现您正在运行旧的 seaborn 版本。
您可以通过以下方式解决此问题:
del sns
!conda update seaborn --yes
import seaborn as sns
sns.__version__
在单独的单元格中。
Seaborn 是 sagemaker 实例上默认 conda 设置的一部分,因此您不能使用 pip install 来修复版本问题。
推荐阅读
- r - 我应该将 registerDoSNOW(parallel) 放在包之外吗?
- ruby-on-rails - 尝试使用 Devise Rails API 注册时,React 表单返回 404 未找到
- reactjs - react-router上的刷新页面输出空白页面,未加载bundle.js
- matlab - 如何在 MATLAB 中控制协方差时计算回归?
- sql - 分组后在 Laravel 中获取计数而不使用 get()
- python - 如何通过每个位置的可能性列表获取每个字符串变化
- mysql - 在 Symfony4 更新功能不起作用,从数据库中获取值之后
- ruby-on-rails - Rails Mongodb 无法保存记录
- javascript - 拖放功能在带有nodejs(javascript)测试自动化框架的selenium webdriver中不起作用
- python - 命令行中的 python filename.py 不起作用