Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metaclass conflict #276

Closed
ericthred opened this issue Sep 25, 2017 · 6 comments · Fixed by #277
Closed

metaclass conflict #276

ericthred opened this issue Sep 25, 2017 · 6 comments · Fixed by #277

Comments

@ericthred
Copy link

ericthred commented Sep 25, 2017

Hello, I've recently started using both pims and trackpy, and love them both. Recently, however, I updated my anaconda environment, and now I get a metaclass conflict whenever I try to import pims. I started with a fresh environment (python 2.7), installing pims from scratch, but I get the same error. uninstalling pims 0.4 and trying again with 0.3.3 does not solve the issue. Can't use either pims or trackpy until I figure this out. Any help would be appreciated.

Error:

In [1]: import pims
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-c035db68c7c1> in <module>()
----> 1 import pims

/Users/ericthred/anaconda3/envs/py2_image/lib/python2.7/site-packages/pims/__init__.py in <module>()
----> 1 from pims.api import *
      2 
      3 from ._version import get_versions
      4 __version__ = get_versions()['version']
      5 del get_versions

/Users/ericthred/anaconda3/envs/py2_image/lib/python2.7/site-packages/pims/api.py in <module>()
      3 
      4 from slicerator import pipeline
----> 5 from pims.base_frames import FramesSequence, FramesSequenceND
      6 from pims.frame import Frame
      7 from pims.display import (export, play, scrollable_stack, to_rgb, normalize,

/Users/ericthred/anaconda3/envs/py2_image/lib/python2.7/site-packages/pims/base_frames.py in <module>()
     14 
     15 
---> 16 class FramesStream(with_metaclass(ABCMeta, object)):
     17     """
     18     A base class for wrapping input data which knows how to

/Users/ericthred/anaconda3/envs/py2_image/lib/python2.7/abc.pyc in __new__(mcls, name, bases, namespace)
     85 
     86     def __new__(mcls, name, bases, namespace):
---> 87         cls = super(ABCMeta, mcls).__new__(mcls, name, bases, namespace)
     88         # Compute set of abstract method names
     89         abstracts = set(name

TypeError: Error when calling the metaclass bases
    metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
@tacaswell
Copy link
Member

Does it work with python3?

@tacaswell
Copy link
Member

tacaswell commented Sep 25, 2017

This looks like this is a bug (?) is six 1.11. Downgrading to six==1.9 fixes the import.

[edit, flubbed on the version numbers]

@tacaswell
Copy link
Member

benjaminp/six#210 and points to the correct fix, we are using both with_metaclass and __metaclass__, you only need one of them.

@danielballan
Copy link
Member

Thanks for flagging this @ericthred. I'll push a bugfix release of pims to PyPI shortly.

@ericthred
Copy link
Author

Awesome, such a fast reply. Thanks for fixing it! Looking forward to getting pims working again.

@jakirkham
Copy link
Contributor

jakirkham commented Oct 4, 2017

Just ran into this issue recently and was about to open an issue when I found you already fixed it. 🎉 Any thoughts on doing a patch release with this change?

Edit: NVM just saw the PyPI release is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants