WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to install python-lirc?  (Read 5228 times)

Offline Standarduser

  • Newbie
  • *
  • Posts: 6
How to install python-lirc?
« on: October 18, 2016, 10:08:40 AM »
Hi,

I'm very new to Tiny Core Linux and am failing on a very simple problem:

I want to run my own Python script using LIRC libraries. LIRC is already installed but python-lirc is missing and I can't find a working way how to install.
The usual ways like dpkg or apt-get are not available.

Could someone please help me?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: How to install python-lirc?
« Reply #1 on: October 18, 2016, 10:50:48 AM »
you'll either need to use python-setuptools to download it or compile it from source.

Alternatively, there is a pylirc extension in the tc-4.x repo if you downgrade to tc-4.x

Offline Standarduser

  • Newbie
  • *
  • Posts: 6
Re: How to install python-lirc?
« Reply #2 on: October 18, 2016, 10:54:19 AM »
Hi Juanito,
thanks for reply. I'm currently trying to install python-setuptools, but just get an error:

Code: (bash) [Select]
tc@piCorePlayer:~$ tce-load -wi python-setuptools
Downloading: python-setuptools.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
md5sum: python-setuptools.tcz.md5.txt: No such file or directory
Error on python-setuptools.tcz
tc@piCorePlayer:~$

Any ideas?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: How to install python-lirc?
« Reply #3 on: October 18, 2016, 10:57:37 AM »
it looks like the download was corrupted - maybe you could delete python-setuptools.tcz.md5.txt and try again?

Offline Standarduser

  • Newbie
  • *
  • Posts: 6
Re: How to install python-lirc?
« Reply #4 on: October 18, 2016, 11:02:01 AM »
This file doesn't exist anywhere

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: How to install python-lirc?
« Reply #5 on: October 18, 2016, 01:21:39 PM »
You don't mention what version and arch you are running, looks like picore, and there is no python-setuptools in picore 8 yet.
The only barriers that can stop you are the ones you create yourself.

Offline Standarduser

  • Newbie
  • *
  • Posts: 6
Re: How to install python-lirc?
« Reply #6 on: October 18, 2016, 01:50:56 PM »
I tried different:
piCorePlayer 3.02 with piCore 8.0 (no python-setuptools available) and piCorePlayer 2.06 with piCore 7.1. python-setuptools are available and installation quits with ok.
But easy_install could not be found on the system. Neither "$ easy_install", nor "$ python easy_install", nor "$ sudo python easy_install".

So, I tried to compile python-lirc from source. For this Cython is needed and again, its not in the repository. So I downloaded the sources and tried to compile them. This ends with

Code: (bash) [Select]
...

running build_ext
cythoning /home/tc/Cython-0.24.1/Cython/Plex/Scanners.py to /home/tc/Cython-0.24.1/Cython/Plex/Scanners.c
building 'Cython.Plex.Scanners' extension
creating build/temp.linux-armv6l-2.7
creating build/temp.linux-armv6l-2.7/home
creating build/temp.linux-armv6l-2.7/home/tc
creating build/temp.linux-armv6l-2.7/home/tc/Cython-0.24.1
creating build/temp.linux-armv6l-2.7/home/tc/Cython-0.24.1/Cython
creating build/temp.linux-armv6l-2.7/home/tc/Cython-0.24.1/Cython/Plex
gcc -pthread -fno-strict-aliasing -O3 -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c /home/tc/Cython-0.24.1/Cython/Plex/Scanners.c -o build/temp.linux-armv6l-2.7/home/tc/Cython-0.24.1/Cython/Plex/Scanners.o
gcc: error trying to exec 'as': execvp: No such file or directory
/home/tc/Cython-0.24.1/Cython/Plex/Scanners.c:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
tc@piCorePlayer:~/Cython-0.24.1$

No idea what I should do now.

Offline Standarduser

  • Newbie
  • *
  • Posts: 6
Re: How to install python-lirc?
« Reply #7 on: October 19, 2016, 07:45:22 AM »
Ok, got Cython running now. The problem was missing "python-dev" and "compile-essentials" packages.

Next try to compile python-lirc ends with
Code: (bash) [Select]
tc@piCorePlayer:~/python-lirc$ sudo python setup.py install
running install
running build
running build_ext
building 'lirc' extension
gcc -pthread -fno-strict-aliasing -O3 -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/lirc/ -I/usr/local/include/python2.7 -c lirc/lirc.c -o build/temp.linux-armv6l-2.7/lirc/lirc.o
lirc/lirc.c:276:30: fatal error: lirc/lirc_client.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
tc@piCorePlayer:~/python-lirc$

Any idea, which package is missing?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: How to install python-lirc?
« Reply #8 on: October 19, 2016, 07:49:24 AM »
lirc-dev (or lirc_client.h is not where python-lirc expects it to be)

Offline Standarduser

  • Newbie
  • *
  • Posts: 6
Re: How to install python-lirc?
« Reply #9 on: October 19, 2016, 08:37:08 AM »
seems, that this file isn't part of lirc-dev.

Had a look at piCorePlayer 3.02 (with piCore 8.0): neither lirc, nor lirc-dev available  >:(