Tiny Core Base > Raspberry Pi
Python 3.6 is unable to find Python's smbus module
gatorback:
smbus is required for a relayboard and is a hurdle to overcome before trying the suggestion to create an python extension.
From the python console smbus is not found with (sudo) Python3.6 and returns:
--- Code: --->>>import smbus
ModuleNotFoundError: No module named 'smbus'
--- End code ---
python 2.7 on the other hand loads smbus.
>>> import smbus
>>>
Why is Python 3.6 not successful finding smbus and what will remedy the issue? What diagnostics can be performed to determine root-cause?
Juanito:
Is it smbus2?
gatorback:
Good question! How can one determine version of the smbus extension?
/mnt/mmcblk0p2/tce/optional/py-smbus.tcz
was downloaded from:
wget http://tinycorelinux.net/7.x/armv6/tcz/py-smbus.tcz
$ md5sum /mnt/mmcblk0p2/tce/optional/py-smbus.tcz
0e8df4164f50c957b7281fd018472e8d /mnt/mmcblk0p2/tce/optional/py-smbus.tcz
gatorback:
Does a version3 of py-smbus exist?
tc@box:~/megaio-rpi/python/megaio$ wget http://tinycorelinux.net/9.x/armv6/tcz/py-smbus.tcz
Connecting to tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
tc@box:~/megaio-rpi/python/megaio$ wget http://tinycorelinux.net/8.x/armv6/tcz/py-smbus.tcz
Connecting to tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
Juanito:
if you look at:
http://tinycorelinux.net/7.x/armv6/tcz/py-smbus.tcz.info
http://tinycorelinux.net/7.x/armv6/tcz/py-smbus.tcz.list
..you can see the details.
What I meant was that the python package available from pip for python3.6 might be called smbus2
To compile it I guess you need:
https://files.pythonhosted.org/packages/6a/06/80a6928e5cbfd40c77c08e06ae9975c2a50109586ce66435bd8166ce6bb3/smbus2-0.3.0.tar.gz
Navigation
[0] Message Index
[#] Next page
Go to full version