Last modified: Jun 06, 2026

Install NiceGUI in Python

NiceGUI is a simple Python framework for building web UIs. It lets you create buttons, sliders, charts, and more with pure Python. No HTML or JavaScript is needed. This guide shows you how to install NiceGUI in Python step by step.

What is NiceGUI?

NiceGUI is an open-source library. It turns your Python script into a live web app. You can add interactive elements like inputs, tables, and plots. It runs on a local server and works in any browser. Many developers use it for dashboards, tools, and demos.

System Requirements

Before installing, check your system. You need Python 3.7 or newer. NiceGUI works on Windows, macOS, and Linux. You also need a modern web browser like Chrome or Firefox. No extra server software is required.

Step 1: Install Python

If you do not have Python, download it from the official site. Choose the latest stable version. During installation, check "Add Python to PATH". This makes Python accessible from the command line. Verify the installation by running python --version in your terminal.

Step 2: Create a Virtual Environment

A virtual environment keeps your project dependencies separate. It prevents conflicts with other Python projects. Open your terminal and navigate to your project folder. Run the command below to create a new environment.

 
# Create a virtual environment named "venv"
python -m venv venv

Activate the environment. On Windows, use venv\Scripts\activate. On macOS or Linux, use source venv/bin/activate. You will see "(venv)" in your terminal prompt. This means the environment is active.

Step 3: Install NiceGUI with pip

Pip is the Python package installer. It comes with Python by default. Use pip to install NiceGUI. Run the following command in your terminal.

 
# Install NiceGUI using pip
pip install nicegui

Pip will download and install NiceGUI and its dependencies. The process usually takes a few seconds. You will see a success message when it finishes.

Step 4: Verify the Installation

Test if NiceGUI installed correctly. Open a Python shell and import the library. If no error appears, the installation is successful.

 
# Check if NiceGUI is installed
import nicegui
print("NiceGUI installed successfully!")

Step 5: Run a Simple App

Create a minimal NiceGUI app to confirm everything works. Write the following code in a file named app.py.

 
# app.py - A simple NiceGUI application
from nicegui import ui

# Create a label and a button
ui.label('Hello from NiceGUI!')
ui.button('Click me', on_click=lambda: ui.notify('Button clicked!'))

# Start the UI
ui.run()

Run the app from your terminal. Use the command python app.py. You will see output similar to this.

 
NiceGUI: Starting server...
NiceGUI: Server started at http://localhost:8080

Open your browser and go to http://localhost:8080. You should see the label and button. Click the button to see a notification. This confirms NiceGUI is working.

Common Installation Issues

If you get errors, check the following. Make sure your virtual environment is active. If pip is outdated, upgrade it with pip install --upgrade pip. On some systems, you may need to use pip3 instead of pip. If you see permission errors, do not use sudo. Instead, use a virtual environment.

Install Specific Version

Sometimes you need a specific version of NiceGUI. Use the command below to install a particular version. Replace "1.0.0" with the version you need.

 
# Install a specific version of NiceGUI
pip install nicegui==1.0.0

Check available versions on the PyPI page. Always use the latest stable version for new projects.

Upgrade NiceGUI

To upgrade to the latest version, run the upgrade command. This ensures you have the newest features and bug fixes.

 
# Upgrade NiceGUI to the latest version
pip install --upgrade nicegui

Uninstall NiceGUI

If you need to remove NiceGUI, use the uninstall command. This cleans up the package from your environment.

 
# Uninstall NiceGUI
pip uninstall nicegui

Type "y" when prompted to confirm.

Using NiceGUI with Other Tools

NiceGUI works well with other Python libraries. You can combine it with pandas for data display. Use matplotlib for charts. The ui.plotly method lets you add interactive plots. This makes NiceGUI a great choice for data apps.

Conclusion

Installing NiceGUI in Python is straightforward. Use a virtual environment for clean project management. Install with pip, verify the setup, and run a simple app. You now have a powerful tool for building web UIs with Python. Start creating your own interactive applications today.