WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: python-smbus  (Read 1486 times)

Offline vitalik2

  • Newbie
  • *
  • Posts: 2
python-smbus
« on: June 20, 2017, 09:03:45 AM »
I would like to integrate a display via i2c and use with python. Unfortunately I can not find a python-smbus package. How can I create such a packet? (Or could someone create that?)
« Last Edit: June 20, 2017, 09:10:32 AM by vitalik2 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14543
Re: python-smbus
« Reply #1 on: June 20, 2017, 09:38:09 AM »
Take a look at the extension making section of the wiki

Offline vitalik2

  • Newbie
  • *
  • Posts: 2
Re: python-smbus
« Reply #2 on: June 20, 2017, 03:25:22 PM »
I try to compile python-smbus and get always this message:

Code: [Select]
root@box:/mnt/mmcblk0p2/i2c-tools/i2c-tools-3.1.2/py-smbus# python setup.py build
running build
running build_ext
building 'smbus' extension
gcc -pthread -fno-strict-aliasing -O3 -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include /python2.7 -c smbusmodule.c -o build/temp.linux-armv6l-2.7/smbusmodule.o
gcc: error trying to exec 'as': execvp: No such file or directory
In file included from /tmp/tcloop/gcc/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/7.1.0/include-fixed/limits.h:194:0,
                 from /tmp/tcloop/gcc/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/7.1.0/include-fixed/syslimits.h:7,
                 from /tmp/tcloop/gcc/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/7.1.0/include-fixed/limits.h:34,
                 from /usr/local/include/python2.7/Python.h:19,
                 from smbusmodule.c:19:
/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/7.1.0/include-fixed/limits.h:194:15: fatal error: limits.h: No such file or directory
 #include_next <limits.h>  /* recurse down to the real one */
               ^~~~~~~~~~
compilation terminated.

Can it be that the gcc.tcz in armv6 repo contains the wrong version of gcc?
because of: /usr/lib/gcc/armv7l-unknown-linux-gnueabihf/7.1.0/include-fixed/limits.h:194:15

I do not know what to do with the error
« Last Edit: June 20, 2017, 03:31:55 PM by vitalik2 »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11220
Re: python-smbus
« Reply #3 on: June 20, 2017, 05:11:58 PM »
Hi vitalik2
Did you install  compiletc.tcz?  I think you might also need  i2c-tools-dev.tcz.