Office365 library installation causes numpy.dtype size change error while executing notebook commands

Pin the Moviepy library version that uses the NumPy version compatible with your Databricks Runtime version.

Written by alberto.umana

Last published at: December 24th, 2024

Problem

After installing the Office365 library on your cluster, you attempt to run a notebook. You encounter an error preventing you from executing code or tasks within the notebook.  

 

“Failure starting repl. Try detaching and re-attaching the notebook. ValueError: numpy.dtype size changed, may indicate binary incompatibility"

 

Cause

When you install the Office365 library (currently, version 0.3.15) on your cluster, that library includes dependent libraries which are incompatible with the NumPy library default version on Databricks Runtime.

 

Specifically, the Office365 library relies on MoviePy, which uses NumPy. The latest version of MoviePy (currently, version: 2.1.1) upgrades the built-in NumPy version on the cluster, which creates an incompatibility issue in the environment. 

 

Solution

Pin the specific MoviePy version that uses the compatible NumPy version built into your Databricks Runtime version.

 

For more information, review the Cluster libraries (AWSAzureGCP) documentation.

 

Important

Pinning a specific version of a library dependency may mean you do not receive any patches or new features. Pinning may also cause dependency issues based on the custom libraries you’re using.

 

 

To prevent similar issues in the future, Databricks recommends:

  • Regularly reviewing and updating your library dependencies to ensure compatibility with the required NumPy version.
  • Monitoring the Databricks release notes and documentation for updates and changes that may affect your libraries and dependencies.

 

For more information about pre-installed libraries on Databricks Runtime versions, refer to the Databricks Runtime release notes versions and compatibility (AWSAzureGCP) documentation.