amazon-bedrock-workshop
amazon-bedrock-workshop copied to clipboard
"apt-get update && apt-get install g++ -y" in bedrock_boto3_setup.jpynb returned error when using latest JupyterLab app in SageMaker Studio
SageMaker recently announced new SageMaker Studio. It has new app type called JupyterLab. I cloned the repo in a JupyterLab app. When run the below code, it returned error.
%%bash
apt-get update && apt-get install g++ -y
Reading package lists...
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
Cell In[6], line 1
----> 1 get_ipython().run_cell_magic('bash', '', 'apt-get update && apt-get install g++ -y\n')
File /opt/conda/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2515, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
2513 with self.builtin_trap:
2514 args = (magic_arg_s, cell)
-> 2515 result = fn(*args, **kwargs)
2517 # The code below prevents the output from being displayed
2518 # when using magics with decorator @output_can_be_silenced
2519 # when the last Python token in the expression is a ';'.
2520 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):
File /opt/conda/lib/python3.10/site-packages/IPython/core/magics/script.py:154, in ScriptMagics._make_script_magic.<locals>.named_script_magic(line, cell)
152 else:
153 line = script
--> 154 return self.shebang(line, cell)
File /opt/conda/lib/python3.10/site-packages/IPython/core/magics/script.py:314, in ScriptMagics.shebang(self, line, cell)
309 if args.raise_error and p.returncode != 0:
310 # If we get here and p.returncode is still None, we must have
311 # killed it but not yet seen its return code. We don't wait for it,
312 # in case it's stuck in uninterruptible sleep. -9 = SIGKILL
313 rc = p.returncode or -9
--> 314 raise CalledProcessError(rc, cell)
CalledProcessError: Command 'b'apt-get update && apt-get install g++ -y\n'' returned non-zero exit status 100.
The issue occurs in SageMaker Notebook instance - JupyterLab.
+1
Also running into this, and prefixed with sudo as well
I was able to get past this with sudo -s before apt-get update && apt-get install g++ -y @awsarippa
Closing this; please refer to the latest bedrock workshop update and reopen if still relevant