Page 1 of 2

solved - problem installing python-yenc

Posted: October 18th, 2016, 2:22 am
by teracow
Hi,

I'm trying (yet again) to get yEnc working in Sab but I'm in need of some assistance.

Sab is currently running on my NAS:
  • Version: develop [unknown]
  • Config File: //share/MD0_DATA/.qpkg/SABnzbdplus/Config/sabnzbd.ini
  • Parameters: SABnzbd.py -f //share/MD0_DATA/.qpkg/SABnzbdplus/Config/sabnzbd.ini --browser 0 --daemon --pid /tmp
  • Python Version: 2.7.11 (default, Aug 18 2016, 12:54:38) [GCC 5.4.0] [UTF-8]
  • OpenSSL: OpenSSL 1.0.2h 3 May 2016 [TLS v1.2, TLS v1.1, TLS v1]
  • yEnc: Not available
I'm using the Entware package manager on this NAS. So:

Code: Select all

opkg install python-pip
and was then able to run:

Code: Select all

pip install http://www.golug.it/pub/yenc/yenc-0.4.0.tar.gz
as linked to by the help icon shown next to "yEnc: Not available" on the Sab Config page. However, this command does not complete. Here is the text shown:

Code: Select all

[/share] # pip install http://www.golug.it/pub/yenc/yenc-0.4.0.tar.gz
Collecting http://www.golug.it/pub/yenc/yenc-0.4.0.tar.gz
  Downloading http://www.golug.it/pub/yenc/yenc-0.4.0.tar.gz (63kB)
    100% |████████████████████████████████| 71kB 57kB/s 
Installing collected packages: yenc
  Running setup.py install for yenc ... error
    Complete output from command /opt/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/opt/tmp/pip-A_lRJO-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /opt/tmp/pip-tzA6xo-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying lib/yenc.py -> build/lib.linux-x86_64-2.7
    warning: build_py: byte-compiling is disabled, skipping.
    
    running build_ext
    building '_yenc' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    x86_64-openwrt-linux-gnu-gcc -fno-strict-aliasing -O2 -pipe -fomit-frame-pointer -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -DNDEBUG -fno-inline -DNDEBUG -O2 -pipe -fomit-frame-pointer -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -fPIC -I/opt/include/python2.7 -c src/_yenc.c -o build/temp.linux-x86_64-2.7/src/_yenc.o -O2 -g
    In file included from src/_yenc.c:21:0:
    src/_yenc.h:21:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-openwrt-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/opt/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/opt/tmp/pip-A_lRJO-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /opt/tmp/pip-tzA6xo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /opt/tmp/pip-A_lRJO-build/
Can anyone see why this fails?

Re: problem installing python-yenc

Posted: October 18th, 2016, 2:27 am
by safihre
You need to install "python-dev" or Python-Development package for the compiling to work!

Re: problem installing python-yenc

Posted: October 18th, 2016, 2:28 am
by teracow
Ah! ;D

I'll try that now...

Re: problem installing python-yenc

Posted: October 18th, 2016, 2:36 am
by teracow
Hmm... next problem:

Code: Select all

[/share] # opkg install python-dev
Installing python-dev (2.7.11-9) to root...
Downloading http://pkg.entware.net/binaries/x86-64/python-dev_2.7.11-9_x86-64.ipk.
Collected errors:
 * check_data_file_clashes: Package python-dev wants to install file /opt/lib/libpython2.7.so
        But that file is already provided by package  * python-base
 * check_data_file_clashes: Package python-dev wants to install file /opt/lib/libpython2.7.so.1.0
        But that file is already provided by package  * python-base
 * opkg_install_cmd: Cannot install package python-dev.

Re: problem installing python-yenc

Posted: October 18th, 2016, 2:42 am
by teracow
Maybe I can run opkg using the "--force-overwrite" option?

And I've also just tried:

Code: Select all

/share] # pip install yenc
Collecting yenc
  Could not find a version that satisfies the requirement yenc (from versions: )
No matching distribution found for yenc

Re: problem installing python-yenc

Posted: October 18th, 2016, 4:05 am
by safihre
Run the command you ran before again:

Code: Select all

pip install http://www.golug.it/pub/yenc/yenc-0.4.0.tar.gz

Re: problem installing python-yenc

Posted: October 18th, 2016, 11:48 am
by teracow
Err... same result as before.

Re: problem installing python-yenc

Posted: October 18th, 2016, 12:23 pm
by safihre
This is after your successfully installed python-dev with the force option?

Re: problem installing python-yenc

Posted: October 18th, 2016, 1:26 pm
by teracow
Ah, no - didn't do that yet - I was waiting to see if you thought that doing so would be a bad idea.

So, you think it would be safe to force overwrite?

Re: problem installing python-yenc

Posted: October 18th, 2016, 1:54 pm
by safihre
I'd say so, they're from the same version of python so should be fine.

Re: problem installing python-yenc

Posted: October 18th, 2016, 2:27 pm
by teracow
Here goes!

Code: Select all

[/share] # opkg install python-dev --force-overwrite
Installing python-dev (2.7.11-9) to root...
Downloading http://pkg.entware.net/binaries/x86-64/python-dev_2.7.11-9_x86-64.ipk.
Configuring python-dev.
:)

Code: Select all

[/share] # pip install http://www.golug.it/pub/yenc/yenc-0.4.0.tar.gz
Collecting http://www.golug.it/pub/yenc/yenc-0.4.0.tar.gz
  Downloading http://www.golug.it/pub/yenc/yenc-0.4.0.tar.gz (63kB)
    100% |████████████████████████████████| 71kB 93kB/s 
Installing collected packages: yenc
  Running setup.py install for yenc ... done
Successfully installed yenc-0.4.0
:D

Code: Select all

[/share] # /etc/init.d/sabnzbd.sh restart
x86_64
x86_64
Shutting down SABnzbdplus at Wed Oct 19 05:18:50 EST 2016... 
 Waiting for SABnzbdplus to shut down: 1, 2, 3, 4, 5, Done (Wed Oct 19 05:18:55 EST 2016)
x86_64
Performing SABnzbdplus prestartup checks at Wed Oct 19 05:18:55 EST 2016...
 Checking for git...  Found!
HEAD is now at 2d77051 V10.15 ready for merge.
Already up-to-date.
 Checking environment
  Checking if all configured directories exist....... Done
  Creating Symbolic links for required utils. Done
Done
From https://github.com/sabnzbd/sabnzbd
   38a943d..01d668a  1.1.x      -> origin/1.1.x
error: 'refs/remotes/origin/bugfixes/pathfix' exists; cannot create 'refs/remotes/origin/bugfixes'
 ! [new branch]      bugfixes   -> origin/bugfixes  (unable to update local ref)
 * [new branch]      feature/obfuscated_parset -> origin/feature/obfuscated_parset
 * [new branch]      feature/rarfile -> origin/feature/rarfile
 + f21ae81...ce0e6ee feature/sabpower -> origin/feature/sabpower  (forced update)
 * [new tag]         1.1.1RC2   -> 1.1.1RC2
error: some local refs could not be updated; try running
 'git remote prune origin' to remove any old, conflicting branches
Starting SABnzbdplus Done (Wed Oct 19 05:19:27 EST 2016)
And after checking the Sab config page:

yEnc now has a nice, big tick mark next to it. ;D

Thanks safihre, we finally got there.

Re: solved - problem installing python-yenc

Posted: October 18th, 2016, 2:51 pm
by safihre
Great :) That should save you some $$$ on the electricity bill :P

Re: solved - problem installing python-yenc

Posted: October 28th, 2016, 9:11 pm
by Iceman24
What source is your Python from? I'm trying to get yEnc going, having trouble determining which source to use for Python. Official QNAP Store is older version, so it seems like from Entware or QPython are other options. Q didn't work for me, so I was wondering what you had.

Thanks.

Re: solved - problem installing python-yenc

Posted: October 29th, 2016, 3:19 pm
by teracow
Yes, I installed Entware's python:

Code: Select all

[/share] # opkg list-installed | grep python
python - 2.7.11-9
python-base - 2.7.11-9
python-codecs - 2.7.11-9
python-compiler - 2.7.11-9
python-ctypes - 2.7.11-9
python-db - 2.7.11-9
python-decimal - 2.7.11-9
python-dev - 2.7.11-9
python-distutils - 2.7.11-9
python-email - 2.7.11-9
python-gdbm - 2.7.11-9
python-light - 2.7.11-9
python-logging - 2.7.11-9
python-multiprocessing - 2.7.11-9
python-ncurses - 2.7.11-9
python-openssl - 2.7.11-9
python-pip - 8.1.2-1
python-pydoc - 2.7.11-9
python-setuptools - 22.0.5-1
python-sqlite3 - 2.7.11-9
python-unittest - 2.7.11-9
python-xml - 2.7.11-9

Re: solved - problem installing python-yenc

Posted: October 29th, 2016, 10:23 pm
by Iceman24
Thanks. Got that python in there, but how do you get Sabnzbd to use it instead of one from QNAP Store?