Sign up here and you can log into the forum!

Python 2.7.9

Here is the place to inquire about app.bins--Only currently available apps for sigma 8655 based wdtv's belong in this forum. requests go in 'Application Questions'

Python 2.7.9   

Postby recliq » Sun Apr 05, 2015 9:11 am

Behold!

It's here (...or rather back)! :mrgreen:

Python for WDLXTV... I finally managed to build a working version of Python 2.7.9 (including setuptools and pip).
It's not hosted in the repository because of it's size. the uncompressed app.bin is 75MB (with some free space inside).
:geek:

It's not tested much for a) I'm not really a python guy and b) lack of time. But test___all__.py completed with ok and I was able to install pip in the image, so it can't be that bad (I hope).

python2.7.9.app.tar.bz2 (MEGA)
python2.7.9-2.app.tar.bz2 (MEGA)

If someone thinks he really needs this, but can't get it from MEGA, PM me.
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Python 2.7.9   

Postby mad_ady » Sun Apr 05, 2015 10:15 am

Now I finally have no excuses to put off migrating from perl to python... But why it's the package size a problem for the repo?
User avatar
mad_ady
Developer
 
Posts: 4525
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Python 2.7.9   

Postby recliq » Sun Apr 05, 2015 11:07 am

The app source is ~50MB... I'll think about it ;)
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Python 2.7.9   

Postby mad_ady » Wed May 27, 2015 1:54 am

While searching for a solution to play back VEVO protected youtube content (I need to run some javascript code to generate a signature), I ran into the option of running youtube-dl (https://github.com/rg3/youtube-dl/blob/master/README.md#readme) to fetch the data (and calculate the signature, etc). It's written in python, and should run with your python version (it's better than the alternative - which is Mozilla Rhino which requires a JRE!).

However, their code is unable to start because it fails to load a module called ctypes:

Code: Select all
root@Deneb:/root# /tmp/youtube-dl -h
Traceback (most recent call last):
  File "/apps/python2.7.9/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/apps/python2.7.9/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/youtube-dl/__main__.py", line 16, in <module>
  File "/tmp/youtube-dl/youtube_dl/__init__.py", line 16, in <module>
  File "/tmp/youtube-dl/youtube_dl/options.py", line 8, in <module>
  File "/tmp/youtube-dl/youtube_dl/downloader/__init__.py", line 3, in <module>
  File "/tmp/youtube-dl/youtube_dl/downloader/common.py", line 9, in <module>
  File "/tmp/youtube-dl/youtube_dl/utils.py", line 9, in <module>
  File "/apps/python2.7.9/lib/python2.7/ctypes/__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes


Here's how to reproduce the issue:
Code: Select all
root@Deneb:/root# python
Python 2.7.9 (default, Apr  4 2015, 14:08:28)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/apps/python2.7.9/lib/python2.7/ctypes/__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes


The files seem to be included:
Code: Select all
root@Deneb:/root# ls -l /apps/python2.7.9/lib/python2.7/ctypes
-rw-r--r--    1 root     root         17585 Apr  4 15:20 __init__.py
-rw-r--r--    1 root     root         20965 Apr  4 18:59 __init__.pyc
-rw-r--r--    1 root     root          2212 Apr  4 15:20 _endian.py
drwxr-xr-x    2 root     root          1024 Apr  4 15:26 macholib
drwxr-xr-x    2 root     root          2048 Apr  4 15:26 test
-rw-r--r--    1 root     root          9067 Apr  4 15:20 util.py
-rw-r--r--    1 root     root          5349 Apr  4 15:20 wintypes.py


and look similar to my ubuntu instalation:
Code: Select all
adrianp@frost:~/downloads$ ls -l /usr/lib/python2.7/ctypes/
total 84
-rw-r--r-- 1 root root 17585 Mar 23  2014 __init__.py
-rw-r--r-- 1 root root 20198 Apr 28 15:43 __init__.pyc
-rw-r--r-- 1 root root  2212 Mar 23  2014 _endian.py
-rw-r--r-- 1 root root  2295 Apr 28 15:43 _endian.pyc
-rw-r--r-- 1 root root  9679 Mar 23  2014 util.py
-rw-r--r-- 1 root root  8053 Apr 28 15:43 util.pyc
-rw-r--r-- 1 root root  5349 Mar 23  2014 wintypes.py
-rw-r--r-- 1 root root  5929 Apr 28 15:43 wintypes.pyc


Any idea why importing _ctypes fails? Is there some compile argument that could enable it?
User avatar
mad_ady
Developer
 
Posts: 4525
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Python 2.7.9   

Postby recliq » Wed May 27, 2015 5:14 am

I'll have a look if I'm back home on friday. I remember that _ctypes was giving some issues but I thought it was compiled...
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Python 2.7.9   

Postby KAD » Wed May 27, 2015 8:20 pm

I was wondering if the version included in Gen3 device could be of use

so I did some checking, it does not seem useful in this case because it seems also does not have working ctypes, but it's part of WD official firmware
anyways for information sake

also my investigation shows another bug to fix in the Gen3 firmware (existing library not found)
but if you do get 2.7.9 fully working, it's probably worth upgrading the version in Gen3 firmware which is currently 2.7.1

Code: Select all
# ldd /opt/bin/python
        libdl.so.2 => /lib/libdl.so.2 (0x2aab4000)
        libpython2.7.so.1.0 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0x2aac8000)
        libutil.so.1 => /lib/libutil.so.1 (0x2aaf2000)
        libz.so.1 => /lib/libz.so.1 (0x2ab06000)
        libm.so.6 => /lib/libm.so.6 (0x2ab2c000)
        libc.so.6 => /lib/libc.so.6 (0x2abb6000)
        /lib/ld.so.1 (0x55550000)
#  LD_PRELOAD=/opt/lib/libpython2.7.so.1.0 python
Python 2.7.1 (r271:Unversioned, Aug  4 2014, 11:43:19)
[GCC 4.3.2] on linux3
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ctypes
>>> exit()

If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: Python 2.7.9   

Postby guidobelix » Thu May 28, 2015 12:10 pm

I don't know if this can be useful for mad_ady problem with youtube-dl, but I have installed python 2.7.3 via optware some time ago (I wanted to experiment with another app written in python) and it seems to have ctypes working:
Code: Select all
# python2
Python 2.7.3 (default, Apr 12 2012, 21:15:41)
[GCC 4.0.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>>

According to the readme on github, it looks like 2.7.3 is enough for youtube-dl to run, but I had no time to try myself.
1.05.04_V.WDLXTV_LIVE-0.5.2.0
User avatar
guidobelix
n00b
 
Posts: 14
Joined: Thu Jul 25, 2013 12:54 am

Re: Python 2.7.9   

Postby recliq » Thu May 28, 2015 4:19 pm

I think I got it, I was missing a library it seems...
Code: Select all
# python
Python 2.7.9 (default, Apr  4 2015, 14:08:28)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from _ctypes import *
>>>

WIll upload a new version tomorrow... :ugeek:
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Python 2.7.9   

Postby mad_ady » Thu May 28, 2015 9:46 pm

Thank you all!
User avatar
mad_ady
Developer
 
Posts: 4525
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Python 2.7.9   

Postby recliq » Fri May 29, 2015 2:13 am

updated first post with new link, let me know if it's any better ;)
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Next

Return to WDLXTV-G2 & WDLXTV-Live/Plus app.bins

Who is online

Users browsing this forum: No registered users and 2 guests