ImportError when importing DatasetWriter module in AEP Notebooks
If you encounter an ImportError with DatasetWriter in Adobe Experience Platform Notebooks, it’s likely due to compatibility issues. Install the correct package version and restart your kernel.
Description description
Environment
- Product: Adobe Experience Platform
- Component: Python Notebook within Data Science Workspace
- Issue Context: Occurs when attempting to import
DatasetWriter
from theplatform_sdk.dataset_writer
module.
Issue/Symptoms
An error occurs when executing the following command in a Python notebook:
from platform_sdk.dataset_writer import DatasetWriter
The error message displayed is an ImportError
, indicating that there is an issue with importing the specified module. This problem may arise due to compatibility issues between installed packages, particularly involving the typing-extensions
package.
Resolution resolution
To resolve this ImportError, follow these steps:
-
Install the correct version of typing-extensions:
Open your Python notebook and execute the following command using magic commands for persistent installation:
%pip install typing-extensions==4.4.0
-
Restart kernel
- After installing the correct version of
typing-extensions
, restart your kernel to ensure all changes take effect. Use the restart button typically located at a corner of your notebook interface. For more information, refer to Kernel Sessions in the Data Science Workspace Guide.
- After installing the correct version of
-
Once restarted, re-execute any read/write operations or other relevant cells that require access to
DatasetWriter
.
By ensuring that you have installed and are using compatible versions of necessary packages, such as typing-extensions
, and restarting your kernel after making changes, you should be able to import and use DatasetWriter
.
Additional Resources
For more information regarding data access in JupyterLab notebooks and relevant terminology, refer to the following resources in the Data Science Workspace Guide.