Skip to content

Setting the project name#

To avoid specifying the project to use when initializing Neptune, you can save the project name as an environment variable.

The full name of a Neptune project has the format workspace-name/project-name.

To find your project name:

  1. Navigate to Settings → Properties
  2. Copy the full name of the project, or keep the page open to copy the name in a moment.

    Where to copy your project name

  3. Next, assign the project name to an environment variable named NEPTUNE_PROJECT:

    Append the following line to your .profile (or other shell configuration file):

    export NEPTUNE_PROJECT="workspace-name/project-name"
    

    where workspace-name/project-name is the full project name you just copied.

    Append the following line to your .profile (or other shell configuration file):

    export NEPTUNE_PROJECT="workspace-name/project-name"
    

    where workspace-name/project-name is the full project name you just copied.

    To set the project name permanently:

    1. Open a terminal app, such as PowerShell or Command Prompt.
    2. Paste in the following command and press enter:

      setx NEPTUNE_PROJECT "workspace-name/project-name"
      

      where workspace-name/project-name is the full project name you just copied.

    3. To activate the change, restart the terminal.

    You can use the os library to set the project name as an environment variable:

    import os
    os.environ["NEPTUNE_PROJECT"] = "workspace-name/project-name"
    

    where workspace-name/project-name is the full project name you just copied.

    Note that any environment variables declared this way won't persist after the notebook kernel shuts down. If you start a new kernel, they need to be set again.

    To set the project only for the current session

    On the command line, enter the following:

    export NEPTUNE_PROJECT="workspace-name/project-name"
    

    In Terminal, enter the following:

    export NEPTUNE_PROJECT="workspace-name/project-name"
    

    In a terminal app, such as PowerShell or Command Prompt, enter the following:

    set NEPTUNE_PROJECT="workspace-name/project-name"
    

Now that you've set the project name as an environment variable, you can omit the project parameter when initializing a Neptune object:

# Initializing a run
run = neptune.init_run(
    project="workspace-name/project-name",
)

# Initializing a model
model = neptune.init_model(
    project="workspace-name/project-name",
    key="TREE",
)

# Initializing a model version
model_version = neptune.init_model_version(
    project="workspace-name/project-name",
    model="CLS-TREE",
)
# Initializing a run
run = neptune.init_run()

# Initializing a model
model = neptune.init_model(key="TREE")

# Initializing a model version
model_version = neptune.init_model_version(model="CLS-TREE")