PROBLEM

Unable to import pdfkit python module in Notebooks in ArcGIS Pro

Last Published: February 9, 2026

Description

In ArcGIS Notebooks within ArcGIS Pro, an error message is returned when a pdfkit Python module is imported.

Error:   
ModuleNotFoundError: No module named 'pdfkit'
Error displayed in ArcGIS Pro Notebook cell

Cause

  • The pdfkit module is not installed in any environment on the machine.
  • The pdfkit module is installed outside the ArcGIS Pro Python environment. ArcGIS Pro uses its own isolated Python environment and in this example, the module is installed in the Windows Command Prompt therefore it cannot be detected.

Solution or Workaround

Depending on the cause, the options below are applicable.

Note:
To install the pdfkit module successfully in the notebook, clone the default ArcGIS Pro Python environment using Package Manager. Refer to ArcGIS Pro: Clone an environment for more information.

Install the pdfkit using the ArcGIS Pro Python Command Prompt

  1. In the Windows taskbar search box, search for and right-click Python Command Prompt > Run as administrator.
Note:
Proceed to Step 3 if the ArcGIS Pro Python cloned environment is activated.
  1. Switch to the ArcGIS Pro Python cloned environment. Press Enter.
activate arcgispro-py3-clone
  1. Install the pdfkit using pip install in the command prompt. Press Enter.
pip install pdfkit
  1. In ArcGIS Pro, open Python Notebook and ensure Code is selected as the cell type.
    Code cell type in ArcGIS Pro Notebooks
  1. Copy and paste the following command into the cell.
import pdfkit
  1. Click the Run this cell and advance (Shift +Enter) Run icon in ArcGIS Pro Notebook icon found above the cell.

Uninstall and reinstall pdfkit in the correct environment

Note:
This workflow is not applicable if the pdfkit is installed in an environment other than Windows Command Prompt.
  1. In the Windows taskbar search box, search for and right-click Command Prompt > Run as administrator.
  2. Check the previous installation path of the pdfkit using pip show. Press Enter.
pip show pdfkit
  1. Remove the previous pdfkit installation using pip uninstall. Press Enter.
pip uninstall pdfkit
Note:
Alternatively, copy the pdfkit location path displayed in Step 2, paste it in File Explorer to locate the file, and manually delete the file.
  1. Refer to the first solution to reinstall the pdfkit in the correct Python environment and import it into the notebook.

Article ID: 000036662

Software:
  • ArcGIS Pro

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options