question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Metaclass conflict when importing discretize

See original GitHub issue

What was done

  1. Using a new python 3.7.3 virtualenv, run pip install discretize
  2. Start the python interpreter
  3. run import discretize

What was seen

>>> import discretize
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ianmacaulay/tmp/venv3/lib/python3.7/site-packages/discretize/__init__.py", line 2, in <module>
    from discretize.TensorMesh import TensorMesh
  File "/Users/ianmacaulay/tmp/venv3/lib/python3.7/site-packages/discretize/TensorMesh.py", line 15, in <module>
    InnerProducts, TensorMeshIO
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

What was expected Discretize should import properly.

OS: MacOS 10.14.6 python: 3.7.3 Version: 0.4.9

The only version that I was able to get to work was 0.4.4 on a clean install, although I was required to install numpy myself before I could install discretize

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
ismacaulaycommented, Aug 15, 2019

@prisae 0.4.10 works fine for me now. Installing matplotlib in 0.4.9 also fixed it. Thanks for getting this resolved so quickly

1reaction
prisaecommented, Aug 13, 2019

Can you do a pip install scooby and then in your Python environment a

import scooby
scooby.Report(['discretize', 'SimPEG'])

and post the output?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving metaclass conflicts - python - Stack Overflow
Heres your problem: The base class has a metaclass that is not the same type as the subclass. That is why you get...
Read more >
metaclass conflict" when importing any class from boxsdk ...
Getting the following error when trying to import any class from boxsdk in Python TypeError: metaclass conflict: the metaclass of a derived ...
Read more >
SOLVING THE METACLASS CONFLICT
The simplest case where a metatype conflict happens is the following. Consider a class A with metaclass M_A and a class B with...
Read more >
SOLVING THE METACLASS CONFLICT « Python recipes «
This is done via the classmaker class factory, wich internally invokes the get_noconflict_metaclass function.
Read more >
OMG Unified Modeling LanguageTM (OMG UML), Infrastructure
The UML metamodel imports and specializes all metaclasses in the ... This excludes hidden ones, i.e., those which have names that conflict with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found