35

I am getting below error when running mlflow app

raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'object'

Can someone help me with this

0

4 Answers 4

41

Since version 1.24 of numpy, np.object is deprecated, and needs to be replaced with object (cf. numpy release notes).

You either need to update this in your code, or another package you're using needs to be updated (not possible to answer without more information).

One (dirty) workaround for now would be to fix your numpy version to the last version still supporting np.object with pip install numpy==1.23.4

Sign up to request clarification or add additional context in comments.

Comments

15

Try :

pip3 install numpy==1.23.5

I was facing same issue with numpy 1.24.2

Comments

9

Try to use simple "monkey path". Add line like

np.object = object    

or

np.int = int    

in case module 'numpy' has no attribute 'int'

np.float = float    

module 'numpy' has no attribute 'int'

np.bool = bool    

and so on... (if problem with last Numpy versions)

3 Comments

sorry vegarus it worked in jupyter notebook but how to modify the object if I run pyscenic from shell? (base) pc@bioinfo:~$ np.object = object np.object: command not found
I haven't got the slightest idea about Pyscenic. Sorry.
For pandas , just use dataset.describe(include='O')
5

Instead of numpy.object:

you should use object or numpy.object_.

OR

import numpy as np
np.object = np.object_

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.