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

Issue installing #34

Open
chaoscreater opened this issue Aug 5, 2020 · 2 comments
Open

Issue installing #34

chaoscreater opened this issue Aug 5, 2020 · 2 comments

Comments

@chaoscreater
Copy link

I've got this working on an old Win10 machine and that's all good. But on a new Win10 machine (same Win10 build 1909) with the same Python version (3.7.2), I can't seem to get this to run.

When running this:
bluetooth_battery cc:98:8b:56:8c:ad

I get this:

PS C:\Users\Ricky\pybluez-0.23> bluetooth_battery cc:98:8b:56:8c:ad                                                                                           Traceback (most recent call last):
  File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Ricky\AppData\Local\Programs\Python\Python37-32\Scripts\bluetooth_battery.exe\__main__.py", line 4, in <module>
  File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\site-packages\bluetooth_battery\bluetooth_battery.py", line 12, in <module>
    import bluetooth
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\site-packages\pybluez-0.23-py3.7-win32.egg\bluetooth\__init__.py", line 39, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\site-packages\pybluez-0.23-py3.7-win32.egg\bluetooth\msbt.py", line 4, in <module>
AttributeError: module 'bluetooth._msbt' has no attribute 'initwinsock'

At first, I thought maybe it's to do with Pybluez. So I've tried installing v0.23 as well as v0.3. Both Pybluez versions installed fine and I was able to install bluetooth_battery OK as well. But whenever I run it, I get the same error message regardless of which Pybluez version I'm using.

@TheWeirdDev
Copy link
Owner

This issue is more related to PyBluez than to this repository.
Try running:

import bluetooth

in a Python shell and if it gives you an error, open a new issue in https://github.com/pybluez/pybluez/ repository and ask them for help. They might know what is wrong.

Also there is a discussion in this issue that might help you: pybluez/pybluez#180

@cheriimoya
Copy link
Contributor

this might be the same issue as pybluez/pybluez#369

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