[MacPorts] #38666: Unable to successfully import lightblue after installation
#38666: Unable to successfully import lightblue after installation ---------------------------+-------------------------------- Reporter: eroninjapan@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Keywords: | Port: py27-lightblue ---------------------------+-------------------------------- I'm running OSX 10.8.3 and have included the error message as well as steps to reproduce below. ------------------------------------ '''sudo port selfupdate''' '''sudo port install py27-lightblue''' '''$ python''' Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information. '''>>> import lightblue''' Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/lightblue/__init__.py", line 160, in <module> from _lightblue import * File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/lightblue/_lightblue.py", line 398, in <module> class _AsyncDeviceInquiry(Foundation.NSObject): TypeError: Error when calling the metaclass bases class _AsyncDeviceInquiry does not fully implement protocol IOBluetoothDeviceInquiryDelegate: no implementation for deviceInquiryDeviceNameUpdated:device:devicesRemaining: -- Ticket URL: <https://trac.macports.org/ticket/38666> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation -----------------------------+-------------------------------- Reporter: eroninjapan@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py27-lightblue | -----------------------------+-------------------------------- Comment (by egall@…): What does `which python` return for you? By the version number it looks like you're using the system one. If that's the case, you might want to try doing `sudo port select python python27` so that MacPorts's python27 is your default python. -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation -----------------------------+-------------------------------- Reporter: eroninjapan@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py27-lightblue | -----------------------------+-------------------------------- Comment (by eroninjapan@…): I ran the commands and the output is below. I'm now using MacPort's Python27 but unfortunately I still encounter the same error when attempting the import. ------------------------------ $ which python /usr/bin/python $ sudo port select python python27 Selecting 'python27' for 'python' succeeded. 'python27' is now active. $ which python /opt/local/bin/python $ python Python 2.7.3 (default, Nov 17 2012, 19:54:34) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin Type "help", "copyright", "credits" or "license" for more information. import lightblue Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/lightblue/__init__.py", line 160, in <module> from _lightblue import * File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/lightblue/_lightblue.py", line 398, in <module> class _AsyncDeviceInquiry(Foundation.NSObject): TypeError: Error when calling the metaclass bases class _AsyncDeviceInquiry does not fully implement protocol IOBluetoothDeviceInquiryDelegate: no implementation for deviceInquiryDeviceNameUpdated:device:devicesRemaining: -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation -----------------------------+-------------------------------- Reporter: eroninjapan@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py27-lightblue | -----------------------------+-------------------------------- Description changed by ryandesign@…: Old description:
I'm running OSX 10.8.3 and have included the error message as well as steps to reproduce below.
------------------------------------
'''sudo port selfupdate'''
'''sudo port install py27-lightblue'''
'''$ python'''
Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information.
'''>>> import lightblue'''
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/lightblue/__init__.py", line 160, in <module> from _lightblue import * File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/lightblue/_lightblue.py", line 398, in <module> class _AsyncDeviceInquiry(Foundation.NSObject): TypeError: Error when calling the metaclass bases class _AsyncDeviceInquiry does not fully implement protocol IOBluetoothDeviceInquiryDelegate: no implementation for deviceInquiryDeviceNameUpdated:device:devicesRemaining:
New description: I'm running OSX 10.8.3 and have included the error message as well as steps to reproduce below. {{{ sudo port selfupdate sudo port install py27-lightblue $ python Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import lightblue
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/lightblue/__init__.py", line 160, in <module> from _lightblue import * File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/lightblue/_lightblue.py", line 398, in <module> class _AsyncDeviceInquiry(Foundation.NSObject): TypeError: Error when calling the metaclass bases class _AsyncDeviceInquiry does not fully implement protocol IOBluetoothDeviceInquiryDelegate: no implementation for deviceInquiryDeviceNameUpdated:device:devicesRemaining: }}} -- -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation -----------------------------+----------------------------- Reporter: eroninjapan@… | Owner: michael.klein@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py27-lightblue | -----------------------------+----------------------------- Changes (by macsforever2000@…): * owner: macports-tickets@… => michael.klein@… Comment: In the future, please Cc the port maintainer(s). -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation -----------------------------+----------------------------- Reporter: eroninjapan@… | Owner: michael.klein@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py27-lightblue | -----------------------------+----------------------------- Comment (by eroninjapan@…): Will do. Thanks for letting me know. -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation -----------------------------+----------------------------- Reporter: eroninjapan@… | Owner: michael.klein@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py27-lightblue | -----------------------------+----------------------------- Comment (by sujitkrao@…): I'm having the same problem on 10.7.5, and looked a bit through the LightBlue source. The Python class _AsyncDeviceInquiry is a wrapper around the Objective-C class IOBluetoothDeviceInquiry and protocol IOBluetoothDeviceInquiryDelegate. It implements some, but not all, of the methods of IOBluetoothDeviceInquiryDelegate, and has a member variable instance IOBluetoothDeviceInquiry that it passes itself to on initialization. Before 10.7, IOBluetoothDeviceInquiryDelegate was an informal protocol, so all of the methods were optional. In 10.7 and later, IOBluetoothDeviceInquiryDelegate is a formal protocol with all of its methods explicitly declared optional, and it like PyObjC doesn't handle the optional methods correctly and throws an exception when not everything is implemented. I added the missing methods to _AsyncDeviceInquiry with empty implementations and it seemed to work: {{{ def deviceInquiryDeviceNameUpdated_device_devicesRemaining_(self, sender, device, devicesRemaining): pass def deviceInquiryUpdatingDeviceNamesStarted_devicesRemaining_(self, sender, devicesRemaining): pass }}} This is my first time messing with Objective-C and PyObjC, so the problem might actually be different, but I was able to import LightBlue after I added the methods. I haven't tested anything else. -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation -----------------------------+----------------------------- Reporter: eroninjapan@… | Owner: michael.klein@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py27-lightblue | -----------------------------+----------------------------- Comment (by gstein@…): Replying to [comment:6 sujitkrao@…]:
... {{{ def deviceInquiryDeviceNameUpdated_device_devicesRemaining_(self, sender, device, devicesRemaining): pass
def deviceInquiryUpdatingDeviceNamesStarted_devicesRemaining_(self, sender, devicesRemaining): pass }}}
I can confirm this patch is correct, and should be applied. You'll note that "everybody" is applying a similar patch, when you look at the downstream network of postskolkovo/lightblue-0.4 at https://github.com/postskolkovo/lightblue-0.4/network -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation -----------------------------+----------------------------- Reporter: eroninjapan@… | Owner: michael.klein@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py27-lightblue | -----------------------------+----------------------------- Comment (by macsforever2000@…): If someone will spend the time to [http://guide.macports.org/#development.patches submit a proper patch], then maybe this will get committed. -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation ----------------------------+-------------------------------- Reporter: eroninjapan@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: py-lightblue | ----------------------------+-------------------------------- Changes (by macsforever2000@…): * owner: michael.klein@… => macports-tickets@… * port: py27-lightblue => py-lightblue Comment: Michael is no longer maintaining this port. See r118707. -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#38666: Unable to successfully import lightblue after installation ----------------------------+-------------------------------- Reporter: eroninjapan@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: Port: py-lightblue | ----------------------------+-------------------------------- Changes (by khindenburg@…): * status: new => closed * resolution: => fixed Comment: fixed in r124057 - still doesn't work for me but that's a different error -- Ticket URL: <https://trac.macports.org/ticket/38666#comment:12> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts