BluePy AttributeError: 'module' object has no attribute 'btle' - python

I'm trying to run python source code to connect and get data from TI Sensortag CC2650.
sudo python sensortagcollector.py
Traceback (most recent call last): File "sensortagcollector.py",
line 223, in <module>
class ScanDelegate(bluepy.btle.DefaultDelegate):
**AttributeError: 'module' object has no attribute 'btle'**
class ScanDelegate(bluepy.btle.DefaultDelegate):
Please help to solve the problem.
I'm running on Ubuntu 16.04
sensortagcollector.py in home directory
bluepy in /usr/local/lib/python2.7/dist-packages (1.3.0)

Related

'collection_names' method on a 'Database' object it is failing because no such method exists

I am trying to deploy this project on ubuntu 20 server
https://github.com/dcai/airnotifier/wiki/Installation-3.x
I followed all the steps but when I try to run the install.py file I am getting the following error
Traceback (most recent call last):
File "install.py", line 64, in <module>
collection_names = masterdb.collection_names()
File "/usr/local/lib/python3.8/dist-packages/pymongo/collection.py", line 3194, in __call__
raise TypeError(
TypeError: 'Collection' object is not callable. If you meant to call the 'collection_names' method on a 'Database' object it is failing because no such method exists.
Python Version is: 3.8.10
MongoDB Version is: 6.0.3
Can anyone advice what should I do?

Zbar on raspberry?

I'm trying use zbar on RPI3 but i have a problem. I dont have ImageScanner, Image... module.
import zbar
scanner = zbar.ImageScanner()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'ImageScanner'
I tried to install it from pip, official repository, some fork, but nothing work.
https://pastebin.com/ajbWdSct
how can i access image modul?
To list module content try to type:
import zbar
dir(zbar)
See example are in source https://github.com/npinchot/zbar/blob/master/examples/read_one.py

AttributeError: 'module' object has no attribute 'moves'

I'm trying to install Ansible, but I can never get a clean install for some reason. using apt-get install ansible and then doing a ansible --version I get the following output:
Traceback (most recent call last):
File "/usr/bin/ansible", line 44, in <module>
import ansible.constants as C
File "/usr/lib/python2.7/dist-packages/ansible/constants.py", line 26, in <module>
from ansible.compat.six import string_types
File "/usr/lib/python2.7/dist-packages/ansible/compat/six/__init__.py", line 40, in <module>
not hasattr(_system_six.moves, 'shlex_quote') or
AttributeError: 'module' object has no attribute 'moves'
Ansible is still very young and OS packaging is lagging behind. Although this particular error may simply be caused by a version mismatch or missing dependency.
May I suggest running Ansible from source?

Python's AttributeError: 'module' object has no attribute 'require_version'

I am using Python3.4. I am trying to open an application which supposedly uses Python and can't seem to get it working. I do receive the following error:
Traceback (most recent call last):
File "pychess", line 24, in <module>
gi.require_version("Gtk", "3.0")
AttributeError: 'module' object has no attribute 'require_version'
Install the dependency with pip install PyGTK, as João Cartucho suggests.

want to connect to dynamoDB, get AttributeError: 'module' object has no attribute 'connect_to_region'

Here is my simple code:
import boto.dynamodb
conn = boto.dynamodb.connect_to_region(
'us-east-1',
aws_access_key_id='....',
aws_secret_access_key='....')
print conn
and I get:
Traceback (most recent call last):
File "startMarch28.py", line 5, in <module>
conn = boto.dynamodb.connect_to_region(
AttributeError: 'module' object has no attribute 'connect_to_region'
There is no connect_to_region() function in boto.dynamodb in boto==2.2.2 version.
Upgrade the module to the latest (2.27.0) version:
pip install boto --upgrade

Categories

Resources