Skip to main content
CommunityCloudEnterprise

Installation

Requirements

  • Python: 3.10 or higher
  • NetBox: 3.3 or higher (for pyNetBox 6.7+)
  • Dependencies:
    • requests>=2.20.0,<3.0
    • packaging

Installation Methods

The easiest way to install pyNetBox is using pip:

pip install pynetbox

Install from Source

If you need the latest development version or want to contribute:

# Clone the repository
git clone https://github.com/netbox-community/pynetbox.git
cd pynetbox

# Install in development mode
pip install -e .

# Or install directly
python setup.py install

It's recommended to use a virtual environment to isolate pyNetBox dependencies:

# Create a virtual environment
python3 -m venv venv

# Activate it (Linux/macOS)
source venv/bin/activate

# Activate it (Windows)
venv\Scripts\activate

# Install pynetbox
pip install pynetbox

Verifying Installation

After installation, verify pyNetBox is installed correctly:

import pynetbox
print(pynetbox.version)

You can also test connectivity to your NetBox instance:

import pynetbox

nb = pynetbox.api(
'http://netbox.example.com',
token='your-api-token-here'
)

# Check NetBox version
print(nb.version)

# Check API status
print(nb.status())

Upgrading

To upgrade to the latest version:

pip install --upgrade pynetbox

To upgrade to a specific version:

pip install pynetbox==7.6.0

Development Installation

If you're planning to develop or contribute to pyNetBox:

# Clone the repository
git clone https://github.com/netbox-community/pynetbox.git
cd pynetbox

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# Install development dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt

# Install in editable mode
pip install -e .

Docker Setup for Testing

The test suite requires Docker for integration tests:

# Ensure Docker is installed and running
docker --version

# Run the test suite
pytest

For more information on running tests, see the Development Guide.

Next Steps