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

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.

Related

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

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)

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 'createLBPHFaceRecognizer'

From this question in SO I understand the error should be solved by having opencv contrib, but the thing is that when I first built opencv using cmake using this guide by pyimagesearch , I had also built opencvcontrib. If I must rebuild it, how exactly should I do it?
This is the error:
import cv2
cv2.createLBPHFaceRecognizer()
Traceback (most recent call last):
File "stdin", line 1, in module
AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'
Also:
import cv2
help(cv2.face.createLBPHFaceRecognizer)
Traceback (most recent call last):
File "stdin", line 1, in module
AttributeError: 'module' object has no attribute 'face'
Mac OS, Python 2.7, Opencv 3.2
After searching high and low, I found that using cv2.face.LBPHFaceRecognizer_create() just do the trick for opencv 3.3.0 with opencv contrib. Hope you find it useful.
createLBPHFaceRecognizer() is in the sub-module cv2.face in python. To access it you should use cv2.face.createLBPHFaceRecognizer().
I have executed this command: pip install opencv-contrib-python
it has install opencv version : 3.4.0,
and it works with this formula:
import cv2
recognizer = cv2.face.LBPHFaceRecognizer_create()

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 tensorflow error, sys has no attribute getdlflags

I Just attempted to install tensorflow for python and when I went to the console to see if the init.py was working it returned this error. I installed it manualy without pip or any other package manager.
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\*username\AppData\Local\Programs\Python\Python35-32\lib\tensorflow\__init__.py", line 43, in <module>
_default_dlopen_flags = sys.getdlopenflags()
AttributeError: module 'sys' has no attribute 'getdlopenflags'
TensorFlow is not supported on Windows yet. Please follow this github issue which tracks TensorFlow Windows support.

Categories

Resources