How to Resolve the 'grep: /root/.ngc/config: No such file or directory' Error When Running the '' File

Hello community,

I encountered a challenge with the ‘’ file during the BioNeMo installation process. I created a blank file using the $ sudo nano command at this path (/home/ubuntu) and pasted the script into it.
Script source: Quickstart Guide — NVIDIA BioNeMo Framework               # Container with tag
LOCAL_REPO_PATH=$(pwd) # This needs to be set to BIONEMO_HOME for local (non-dockerized) use
DOCKER_REPO_PATH=/workspace/bionemo # This is set to BIONEMO_HOME in container
JUPYTER_PORT=8888                                                        # Jupyter port for inference notebooks                                                         # Only required for registry login
REGISTRY_USER='$oauthtoken'                                              # Only required for registry login
NGC_CLI_API_KEY=$(grep -m 1 apikey ~/.ngc/config | head -n 1 | cut -d' ' -f3) # Requires NGC cli configuration

When I attempted to run it using $ sudo sh pull, it displayed the following output: grep: /root/.ngc/config: No such file or directory.

Therefore, I edited this line from:

NGC_CLI_API_KEY=$(grep -m 1 apikey ~/.ngc/config | head -n 1 | cut -d' ' -f3)


NGC_CLI_API_KEY=$(grep -m 1 apikey /home/ubuntu/.ngc/config | head -n 1 | cut -d' ' -f3)

Then, I ran $ sudo sh pull again, but nothing showed in the terminal.

How can I fix this issue? What should be expected as terminal output if this script works correctly?

Hi KindnessCUDA,

From the error, it looks like the NGC_CLI_API_KEY variable is not set.
To resolve this, you can either do export NGC_CLI_API_KEY=<Your_NGC_API_Key>

Or run ngc config set before running script from the terminal.

1 Like

Thank You for the Reply!

To ensure the NGC_CLI_API_KEY variable is set correctly, I ran the $ cat .ngc/config command, and the result was something like this:

;WARNING - This is a machine-generated file. Do not edit manually.
;WARNING - To update local config settings, see "ngc config set -h"

apikey = MyActualAPIKey
format_type = ascii
org = MyActualOrgName
org_display_name = MyActualOrgDisplayName
team = MyActualTeamName

However, to double-check and ensure accuracy, I created a new API Key and Team from the NVIDIA NGC control panel and ran ngc config set again to update the information. However, the result for the $ sudo sh pull command was the same as described above.

Also, the same result occurred after running export NGC_CLI_API_KEY=<My_NGC_API_Key>.

$ sudo sh pull
grep: /root/.ngc/config: No such file or directory

The bash pull command executes docker pull

To run that command successfully, you will need to perform docker login

Instructions are provided here: Docker container access

After pulling an image, you can use the docker run command to create and start the BioNeMo Framework container based on that image.