Last modified: Jun 02, 2026

Pip Install Plotly Graph Objects

Plotly is a powerful library for interactive visualizations. The plotly.graph_objects module lets you build complex charts. This guide shows you how to install it easily.

You need Python 3.6 or later. You also need pip, the Python package manager. Most Python installations include pip by default.

Step 1: Open Your Terminal

Open your command prompt, terminal, or PowerShell. This is where you type commands. On Windows, search for "cmd". On macOS or Linux, open the Terminal app.

Step 2: Run the Install Command

The simplest way is to use pip. Type this command and press Enter:


pip install plotly

This command installs the full Plotly library. This includes plotly.graph_objects. You do not need a separate install for graph objects.

If you only want graph objects, you can still use the same command. The package name is always plotly. The graph objects module comes inside it.

Step 3: Verify the Installation

Check if the installation worked. Run Python in your terminal. Then import the module.


# Import graph objects to verify install
import plotly.graph_objects as go

# Create a simple figure
fig = go.Figure(data=go.Scatter(x=[1, 2, 3], y=[4, 5, 6]))

# Show the figure
fig.show()

Output: A new browser window opens with an interactive scatter plot.

If you see a plot, the installation is successful. If you get an error, continue reading.

Common Installation Issues

Problem: pip not found

If your system says "pip is not recognized", use pip3 instead. On some systems, Python 3 uses pip3.


pip3 install plotly

Problem: Permission denied

On macOS or Linux, you might see permission errors. Use --user to install for your user only.


pip install plotly --user

Problem: Using a virtual environment

It is best to use a virtual environment. This keeps your projects separate. First, create and activate a virtual environment.


# Create virtual environment
python -m venv myenv

# Activate on Windows
myenv\Scripts\activate

# Activate on macOS/Linux
source myenv/bin/activate

# Now install plotly
pip install plotly

Installing a Specific Version

Sometimes you need an older version. Use the == operator to specify the version.


pip install plotly==5.14.0

Check the current version after install.


import plotly
print(plotly.__version__)

Output: 5.14.0

Using Plotly Graph Objects

Once installed, you can start building charts. The go.Figure function creates a figure. The go.Scatter function creates a trace.


import plotly.graph_objects as go

# Create data
x_data = [1, 2, 3, 4]
y_data = [10, 11, 12, 13]

# Create figure with scatter trace
fig = go.Figure(data=go.Scatter(x=x_data, y=y_data, mode='markers'))

# Update layout
fig.update_layout(title='My First Plot', xaxis_title='X Axis', yaxis_title='Y Axis')

# Show plot
fig.show()

You can also create bar charts, line charts, and more. The plotly.graph_objects module gives you full control. For a deeper look, read our Python Plotly Graph Objects Visualization Guide.

Upgrading Plotly

Keep your library up to date. Use the --upgrade flag.


pip install --upgrade plotly

Uninstalling Plotly

If you need to remove it, use the uninstall command.


pip uninstall plotly

Offline Installation

If you have no internet, download the wheel file first. Then install locally.


# Download from PyPI on another machine
# Then copy the .whl file to your machine
pip install plotly-5.14.0-py3-none-any.whl

Best Practices

Always use a virtual environment. This avoids conflicts with other projects. Also, pin your version in a requirements.txt file.


# Create requirements file
pip freeze | grep plotly >> requirements.txt

# Install from requirements later
pip install -r requirements.txt

Check if your environment has the correct Python version. Plotly works best with Python 3.7 and above.

Conclusion

Installing Plotly Graph Objects is simple. Just run pip install plotly. You get the full library with graph objects included. Use a virtual environment for clean projects. If you hit errors, check permissions or use pip3. Start building interactive charts today. For more advanced features, explore the Python Plotly Graph Objects Visualization Guide.