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

Cannot import name protocols #27

Open
nguillermin opened this issue Aug 19, 2015 · 2 comments
Open

Cannot import name protocols #27

nguillermin opened this issue Aug 19, 2015 · 2 comments

Comments

@nguillermin
Copy link

OS X 10.10.5, homebrew-installed Python 2.7.10

$ python2.7 test/runtests.py 
Traceback (most recent call last):
  File "test/runtests.py", line 8, in <module>
    from test_video import *
  File "/Users/megablanc/Developer/mirovideoconverter3/test/test_video.py", line 8, in <module>
    from mvc import video
  File "test/../mvc/__init__.py", line 5, in <module>
    from mvc import conversion
  File "test/../mvc/conversion.py", line 12, in <module>
    from mvc.video import get_thumbnail_synchronous
  File "test/../mvc/video.py", line 8, in <module>
    from mvc.widgets import idle_add
  File "test/../mvc/widgets/__init__.py", line 7, in <module>
    from .osx import widgetset
  File "test/../mvc/widgets/osx/widgetset.py", line 45, in <module>
    from .layout import VBox, HBox, Alignment, Table, Scroller, Expander, TabContainer, DetachedWindowHolder
  File "test/../mvc/widgets/osx/layout.py", line 49, in <module>
    import tableview
  File "test/../mvc/widgets/osx/tableview.py", line 50, in <module>
    import tablemodel
  File "test/../mvc/widgets/osx/tablemodel.py", line 34, in <module>
    from AppKit import (NSDragOperationNone, NSDragOperationAll, NSTableViewDropOn,
ImportError: cannot import name protocols

The full line at tablemodel.py:34 is

from AppKit import (NSDragOperationNone, NSDragOperationAll, NSTableViewDropOn,
                     NSOutlineViewDropOnItemIndex, protocols)

I've tried importing NSDragOperationNone, NSDragOperationAll, NSTableViewDropOn, NSOutlineViewDropOnItemIndex individually from python interpreter with no issue. from AppKit import protocols fails.

@Rudloff
Copy link

Rudloff commented Jan 19, 2016

Same problem on OSX 10.11.

@ronaldoussoren
Copy link

The import of "protocols" is not necessary with recent versions of PyObjC. When using explicit protocols use objc.protocolNamed("name"), and it is never necessary to use an informal protocol object (which is why framework wrappers no longer explose those)

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

No branches or pull requests

3 participants