Java not found when running Sagemaker Studio python notebooks

0

Here is the issue I'm currently facing when running the Python package (pypmml) within Sagemaker Studio notebooks. I am encountering a "No such file or directory: 'java': 'java'" error.

It seems that the error arises from Java not being installed for the Python kernel. I attempted the following solutions, but unfortunately, none of them resolved the error:

  1. I successfully used 'yum install java' in the terminal but no luck to call the java within notebooks.
  2. The 'sudo install' command inside Studio notebook is disabled.

Can someone please provide guidance on how to install java or specify the java path within Sagemaker Studio notebooks?

質問済み 1年前2030ビュー
2回答
1

You're correct that the issue is that the Python kernel isn't aware of the Java installation, but unfortunately, you cannot install software or use 'sudo' commands in SageMaker notebook instances directly.

Please read the following carefully :

https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-root-access.html

as a summary

Create a Lifecycle Configuration: A lifecycle configuration is a script that you can use to customize the notebook instance setup. In your lifecycle configuration, you can install Java and set the appropriate environment variables.

Example Script

#!/bin/bash

set -e

sudo yum -y update
sudo yum -y install java-1.8.0-openjdk-devel
profile picture
エキスパート
回答済み 1年前
profile picture
エキスパート
レビュー済み 1ヶ月前
  • The link you've shared is for Notebook Instances (NBIs). NBIs come with Java installed, and you can install software and use sudo commands as long as your notebook doesn't restrict root access. The question is pertaining to Studio notebooks.

  • Please see my errors below after Lifecycle Configuration setups.

0

Thanks for your response, @sdtslmn. After going through the setups of Lifecycle Configuration. I got the following error when start-up the script. Do you spot anything wrong here? Enter image description here

回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ