cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issues importing mediapipe TypeError: 'numpy._DTypeMeta' object is not subscriptable

StephanieAlba
Databricks Employee
Databricks Employee

TypeError: 'numpy._DTypeMeta' object is not subscriptable

Screenshot 2023-08-16 at 8.10.59 AM.png

Screenshot 2023-08-16 at 7.38.45 AM.png

I have tried upgrading pip and installing newer and older versions of NumPy.

Screenshot 2023-08-16 at 7.39.06 AM.png

1 ACCEPTED SOLUTION

Accepted Solutions

StephanieAlba
Databricks Employee
Databricks Employee

Turns out that detaching and reattaching the notebook from the cluster does not do it. My journey is detailed here https://stackoverflow.com/a/76923874/1290485

TLDR; With notebook-scoped libraries, use 

dbutils.library.restartPython() 

numpy==1.23 works.

View solution in original post

3 REPLIES 3

Jenny123456
New Contributor II

Got the same issue. Tried to install numpy 1.19.3 but got below errors:
ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

StephanieAlba
Databricks Employee
Databricks Employee

Turns out that detaching and reattaching the notebook from the cluster does not do it. My journey is detailed here https://stackoverflow.com/a/76923874/1290485

TLDR; With notebook-scoped libraries, use 

dbutils.library.restartPython() 

numpy==1.23 works.

madengr00
New Contributor II

I ran into the same issue.  Before installing OpenCV I was on Numpy 1.21.5 in my notebook.  After upgrading to 1.23, the error went away for me.  

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group