Installation and setup

Install Neptune client library

Before you start, make sure that:
  • You have Python 3.7+ on your system,
  • You have pip or conda installed.
Depending on your operating system open a terminal or CMD and run this command:
pip
conda
pip install neptune-client
conda install -c conda-forge neptune-client
If you're installing through Anaconda Navigator and can't find Neptune, you need to add "conda-forge" to your channels and update the package index. Note: The displayed version may be outdated. The latest version of the package will be installed.

Authentication (Neptune API token)

Get API token
  • Click on the User menu button (where your user Avatar is)
  • Click Get Your API token. This will open a modal window.
  • Copy your API token
You can also get your API token directly from here.
Set to the environment variable
Assign it to the bash environment variable NEPTUNE_API_TOKEN:
Linux
Windows
macOS
Notebook
export NEPTUNE_API_TOKEN='YOUR_API_TOKEN'
set NEPTUNE_API_TOKEN="YOUR_API_TOKEN"
export NEPTUNE_API_TOKEN='YOUR_API_TOKEN'
from getpass import getpass
api_token = getpass('Enter your private Neptune API token: ')
or append this line to your ~/.bashrc or ~/.bash_profile files (recommended).
You can also pass your Neptune API token to the api_token argument of neptune.init()
# Create run in project
run = neptune.init(api_token='<YOUR_API_TOKEN>')
Always keep your API token secret - it is like a password to the application. Appending the “export NEPTUNE_API_TOKEN=’YOUR_LONG_API_TOKEN’” line to your ~/.bashrc or ~/.bash_profilefile is the recommended method to ensure it remains secret.

Setting the project name

To log Runs into a Project you need to know the full name of your Project. It has a format of:workspace_name/project_name.
To find your Project name:
  • go to your project in the Neptune UI
  • go to Settings > Properties
  • copy the full project name from there
Set to the environment variable
Assign it to the bash environment variable NEPTUNE_PROJECT:
Linux
Windows
macOS
export NEPTUNE_PROJECT='<YOUR_WORKSPACE/YOUR_PROJECT>'
set NEPTUNE_PROJECT='<YOUR_WORKSPACE/YOUR_PROJECT>'
export NEPTUNE_PROJECT='<YOUR_WORKSPACE/YOUR_PROJECT>'
or append this line to your ~/.bashrc or ~/.bash_profile files (recommended).
You can also pass your project name to the project argument of neptune.init()
# Create run in project
run = neptune.init(project='my_workspace/my_project')

Deploy Neptune on your own server (on-premises)

You can also deploy Neptune on your own infrastructure. If you are interested in that read: How to deploy Neptune on-prem

FAQ

ModuleNotFoundError: No module named ‘neptune’

When you get this error it means that you don't have Neptune client library installed on your system.
To install it, open a terminal or CMD, depending on your operating system, and run:
pip
conda
pip install neptune-client
conda install -c conda-forge neptune-client

What's next?