Help: Broken qwiic module for Python

The sparkfun-qwiic package for python appears to be fundamentally broken on my RaspberryPi3 (raspbian version Jesse)

Specifically, I successfully installed the module using

sudo pip3 install sparkfun-qwiic

but when I run the following simple program

import qwiic
# attempt to get list of current devices (fails!)
results = qwiic.list_devices()
print(results)

I get the error traceback

Traceback (most recent call last):

File “./qwiic.py”, line 3, in

import qwiic

File “/home/pi/Programs/qwiic.py”, line 9, in

results = qwiic.list_devices()

AttributeError: ‘module’ object has no attribute ‘list_devices’

This error first came up under Python 2.7, and I thought upgrading to Python 3.4 might fix it, but no such luck.

I also tried dir(qwiic), and it confirms that there are apparently no callable functions/methods of any kind associated with the module. I couldn’t find any mention of this problem by anyone else, so there must be something peculiar about my setup. I haven’t had a similar problem with any other Python module.

So the problem described above goes away if I copy the source code file at https://raw.githubusercontent.com/spark … init_.py to a file qwiic.py in my working directory. This suggests that there’s something wrong with the installation process rather than the code itself. Since I don’t know what happens under the hood when a module is installed, I’m not sure how to track down the problem.

Have you had any luck? I just got my Qwiic kit and I’m stuck at the part trying to install Qwiic following their guide.

sudo pip install sparkfun_qwiic
sudo: pip: command not found

I did sudo pip3 install and that seemed to work, but still can’t get Qwiic to work. I continue to work through all the broken and missing modules until I think I get it to work and run the test code:

import qwiic
results = qwiic.list_devices()
print(results)

and get

[(61, 'Qwiic Micro OLED', 'QwiicMicroOled'), (91, 'Qwiic CCS811', 'QwiicCcs811'), (96, 'Qwiic Proximity Sensor', 'QwiicProximity'), (119, 'Qwiic BME280', 'QwiicBme280')]

but when it comes time to run the actual program I’m met with so many “has no attribute” errors

Traceback (most recent call last):
  File "qwiic_kit_for_pi_demo.py", line 64, in <module>
    oled.setFontType(1) 
AttributeError: 'QwiicMicroOled' object has no attribute 'setFontType'

comment out that section and…

Traceback (most recent call last):
  File "temp.py", line 93, in <module>
    proximity = prox.getProximity()
AttributeError: 'QwiicProximity' object has no attribute 'getProximity'

Hi everyone,

DamagedDolphin, I believe you posted this issue on the tutorial [here and a member of our tutorials team responded with some information about the issue and an update for the GitHub repo that should fix it.

gpetty, try running that install again and let me know if you’re still having issues. As far as I am aware, it should be fixed for Python 3.7.](https://learn.sparkfun.com/tutorials/qwiic-kit-for-raspberry-pi-hookup-guide/discuss#comment-5d36c3ef33766d6215138324)