"metaclass conflict " error on MAC OS #5532
-
When I run with python 3.9.18 import phoenix as px I got an error like this:
I check the defination of ObjectProxy and ABC, they are really different. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Hey, @yingflower! 👋 I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. The "metaclass conflict" error occurs when a class inherits from multiple base classes that have incompatible metaclasses. In your case, the To resolve this issue, you can create a custom metaclass that combines the metaclasses of
Here's an example of how you might implement this: from wrapt import ObjectProxy
from abc import ABC, ABCMeta
# Define a custom metaclass that combines the metaclasses of ObjectProxy and ABC
class CombinedMeta(ABCMeta, type(ObjectProxy)):
pass
# Use the custom metaclass for ModelData
class ModelData(ObjectProxy, ABC, metaclass=CombinedMeta):
"""pd.DataFrame or pd.Series wrapped with extra functions and metadata."""
@property
@abstractmethod
def null_value(self) -> Any:
pass This approach should resolve the metaclass conflict by ensuring that the |
Beta Was this translation helpful? Give feedback.
-
Hey @yingflower, what version of Phoenix are you running that you are encountering this error? |
Beta Was this translation helpful? Give feedback.
-
I believe the issue is with the wrapt library, which was updated last week from version 1.16.0 to version 1.17.0. Forcing the use of version 1.16.0 worked for me ( |
Beta Was this translation helpful? Give feedback.
Hey, @yingflower! 👋 I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer.
The "metaclass conflict" error occurs when a class inherits from multiple base classes that have incompatible metaclasses. In your case, the
ModelData
class is inheriting from bothObjectProxy
andABC
, which have conflicting metaclasses.To resolve this issue, you can create a custom metaclass that combines the metaclasses of
ObjectProxy
andABC
. Here's a general approach to address this:Define a Custom Metaclass: Create a metaclass that inherits from both metaclasses used by
ObjectProxy
andABC
.Use the Custom Metaclass: Apply this custom metaclass to the
Model…