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

Python 3 Compatibility #31

Open
3DCoded opened this issue Jan 23, 2021 · 12 comments
Open

Python 3 Compatibility #31

3DCoded opened this issue Jan 23, 2021 · 12 comments

Comments

@3DCoded
Copy link

3DCoded commented Jan 23, 2021

I am using MacOS 11.1 and Python 3.9.1 64-bit. When I try to import WonderPy, I get an error:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import WonderPy
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/WonderPy/__init__.py", line 1, in <module>
    from . import core        # noqa
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/WonderPy/core/__init__.py", line 1, in <module>
    from wwCommands  import WWCommands  # noqa
ModuleNotFoundError: No module named 'wwCommands'

Is there a way to use this package in Python 3?

@3DCoded 3DCoded closed this as completed Jan 23, 2021
@3DCoded 3DCoded reopened this Jan 23, 2021
@kevincowan
Copy link

kevincowan commented Jan 29, 2021

I got the same WWCommands error on Python 3 with MacOS 11.1

I get this error on Python 2.7 - how did you get past it? @smattar2020

➜ python tutorial/01_hello_world.py Traceback (most recent call last): File "tutorial/01_hello_world.py", line 76, in <module> WonderPy.core.wwMain.start(MyClass()) File "/Users/kevincowan/Documents/Dash/WonderPyExamples/venv/lib/python2.7/site-packages/WonderPy/core/wwMain.py", line 6, in start WonderPy.core.wwBTLEMgr.WWBTLEManager(delegate_instance, arguments).run() File "/Users/kevincowan/Documents/Dash/WonderPyExamples/venv/lib/python2.7/site-packages/WonderPy/core/wwBTLEMgr.py", line 70, in __init__ self.ble = Adafruit_BluefruitLE.get_provider() File "/Users/kevincowan/Documents/Dash/WonderPyExamples/venv/lib/python2.7/site-packages/Adafruit_BluefruitLE/platform.py", line 42, in get_provider from .corebluetooth.provider import CoreBluetoothProvider File "/Users/kevincowan/Documents/Dash/WonderPyExamples/venv/lib/python2.7/site-packages/Adafruit_BluefruitLE/corebluetooth/provider.py", line 39, in <module> from .objc_helpers import uuid_to_cbuuid File "/Users/kevincowan/Documents/Dash/WonderPyExamples/venv/lib/python2.7/site-packages/Adafruit_BluefruitLE/corebluetooth/objc_helpers.py", line 30, in <module> bundle_path=objc.pathForFramework(u'/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Frameworks/CoreBluetooth.framework')) File "/Users/kevincowan/Documents/Dash/WonderPyExamples/venv/lib/python2.7/site-packages/objc/_dyld.py", line 122, in pathForFramework fpath, name, version = infoForFramework(dyld_find(path)) File "/Users/kevincowan/Documents/Dash/WonderPyExamples/venv/lib/python2.7/site-packages/objc/_dyld.py", line 117, in dyld_find return dyld_framework(filename, framework_name, version) File "/Users/kevincowan/Documents/Dash/WonderPyExamples/venv/lib/python2.7/site-packages/objc/_dyld.py", line 88, in dyld_framework raise ImportError("Framework %s could not be found" % (framework_name,)) ImportError: Framework CoreBluetooth could not be found

@3DCoded
Copy link
Author

3DCoded commented Feb 4, 2021

I think I enabled Bluetooth for Python or whatever Code IDE you may be using. I think the Dash/Dot/Cue has to be on when you import it.

@kevincowan
Copy link

That didn't help @smattar2020 I'd really love to know how you got this to work on Python 2.7 on MacOS 11.1 - thanks!

@3DCoded
Copy link
Author

3DCoded commented Feb 6, 2021

I did it a while ago and am not sure I remember how to do it. This issue is for making it work on Python3, not Python 2.

@3DCoded
Copy link
Author

3DCoded commented Feb 6, 2021

You may have to install CoreBluetooth somehow

@3DCoded
Copy link
Author

3DCoded commented Feb 6, 2021

@kevincowan
Copy link

I tried that and it didn't work

I know you are trying to get Python3 working - I can't make it work on Python 2.7 on 11.1

@3DCoded
Copy link
Author

3DCoded commented Feb 7, 2021

I have uninstalled Python 2 recently because it was deprecated since December 2020 and because it was crashing my Mac. I think if you are trying to get it to work on Python 2 on macOS Big Sur, you should open your own issue for that.

@kevincowan
Copy link

Agreed - thanks for your help. We really need it work on Python 3

@kevincowan
Copy link

I've emailed their support to ask about Python 3 support - we need this

@mewmix
Copy link

mewmix commented Mar 25, 2024

I ported some work by the github community to use bleak backend instead of pygatt, and I have tested on my mac m1 and windows machine for anyone still looking.

https://github.com/mewmix/bleak-dash

@kevincowan
Copy link

@mewmix You are a hero! Can't wait to try this!

Thanks

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