0

Python doesn't find Adafruit library or the modules.
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Python doesn't find Adafruit library or the modules.

by robcj07 on Fri Jul 14, 2017 6:54 pm

Hello
I want to start programming with Python on my BeagleBone Black but seem to fail due to the next error

Code: Select all | TOGGLE FULL SIZE
~# python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Adafruit_BBIO.GPIO

I followed a guide for installing the Adafruit_BBIO library here: https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/installation-on-ubuntu

However I got outputs stating it was already installed. At the end of the guide it is possible to test the installation by running:

Code: Select all | TOGGLE FULL SIZE
sudo python -c "import Adafruit_BBIO.GPIO as GPIO; print GPIO"

#you should see this or similar:
<module 'Adafruit_BBIO.GPIO' from '/usr/local/lib/python2.7/dist-packages/Adafruit_BBIO/GPIO.so'>


but the installation says this:
Code: Select all | TOGGLE FULL SIZE
Requirement already satisfied: Adafruit_BBIO in /usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-1.0.0-py2.7-linux-armv71.egg


It is confusing so I would like some help.I have Debian 8 on the BBB

robcj07
 
Posts: 9
Joined: Fri Jul 14, 2017 6:44 pm

Re: Python doesn't find Adafruit library or the modules.

by drewfustini on Sat Jul 15, 2017 1:21 am

I'd like to know more about the system software on your beaglebone. Please paste the output of these commands:

uname -a

cat /etc/dogtag

cat /etc/debian_version

cat /sys/devices/platform/bone_capemgr/slots

cat /proc/cmdline

cat /boot/uEnv.txt

drewfustini
 
Posts: 717
Joined: Sat Dec 26, 2015 1:19 pm

Re: Python doesn't find Adafruit library or the modules.

by drewfustini on Sat Jul 15, 2017 1:25 am

Also please install Adafruit_BBIO from the GitHub repo and see if the problem persists:


git clone https://github.com/adafruit/adafruit-be ... -io-python

cd adafruit-beaglebone-io-python/

sudo make install

drewfustini
 
Posts: 717
Joined: Sat Dec 26, 2015 1:19 pm

Re: Python doesn't find Adafruit library or the modules.

by robcj07 on Sat Jul 15, 2017 2:46 pm

Here are the outputs Drew:
Code: Select all | TOGGLE FULL SIZE
~# uname -a
Linux beaglebone 4.4.30-ti-r64 #1 SMP Fri Nov 4 21:23:33 UTC 2016 arm71 GNU/Linux

~# cat /etc/dogtag
Beagleboard.org Debian Image 2016-11-06

~# cat /etc/debian_version
8.6

~# cat /sys/devices/platform/bone_capemgr/slots
 0: PF----  -1
 1: PF----  -1
 2: PF----  -1
 3: PF----  -1
 4: P-O-L-  0 Override Board Name,00A0, Override Manuf, cape-universaln

~# cat /proc/cmdline
console=tty0 console=tty00,115200n8 capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4, BB-UART5 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait coherent_pool=1M quiet cape_inoversal=enable

~# cat /boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.4.30-ti-r64
#uuid=
#dtb=

##BeagleBone Black/Green dtb's for v4.1.x (BeagleBone White just works..)

##BegaleBone Black: HDMI (Audio/Video) disabled:
#dtb=am335x-boneblack-emmc-overlay.dtb

##BegaleBone Black: eMMC disabled:
#dtb=am335x-boneblack-hdmi-overlay.dtb

##BegaleBone Black: HDMI Audio/eMMC disabled:
#dtb=am335x-boneblack-nhdmi-overlay.dtb

##BegaleBone Black: HDMI (Audio/Video)/eMMC disabled:
#dtb=am335x-boneblack-overlay.dtb

##BegaleBone Black: wl1835
#dtb=am335x-boneblack-wl1835mod.dtb

##BegaleBone Green: eMMC disabled
#dtb=am335x-bonegreen-overlay.dtb

cmdline=coherent_pool_1M quiet cape_universal=enable

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M quiet cape_universal=enable video=HDMI-A-1:1024x768@60e

##Example v3.8.x
#cape_diasable=capemgr.disable_partno=
cape_enable=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4, BB-UART5

##Example v4.1.x
#cape_diasable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

robcj07
 
Posts: 9
Joined: Fri Jul 14, 2017 6:44 pm

Re: Python doesn't find Adafruit library or the modules.

by robcj07 on Sat Jul 15, 2017 4:23 pm

drewfustini wrote:Also please install Adafruit_BBIO from the GitHub repo and see if the problem persists:


git clone https://github.com/adafruit/adafruit-be ... -io-python

cd adafruit-beaglebone-io-python/

sudo make install


I did the manual installation on Ubuntu/Debian and python seems to be running just fine. Thanks a lot!

robcj07
 
Posts: 9
Joined: Fri Jul 14, 2017 6:44 pm

Please be positive and constructive with your questions and comments.