Page 1 of 1

FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 20th, 2009, 12:19 pm
by silkie
Gents,

FreeBSD7.2 - Installed at the weekend just got around to rebuilding this.

bsss# SABnzbd.py --server x.x.x.x --browser 0 --logging 0 --weblogging 0 --daemon --config-file /root/.sabnzbd/sabnzbd.ini --permissions 0777 &
[1] 79190
bsss# Traceback (most recent call last):
  File "/usr/local/bin/SABnzbd.py", line 42, in
    import cherrypy
  File "/usr/local/lib/python2.5/site-packages/cherrypy/__init__.py", line 10, in
    import config
  File "/usr/local/lib/python2.5/site-packages/cherrypy/config.py", line 8, in
    from cherrypy.lib import autoreload, cptools, httptools
  File "/usr/local/lib/python2.5/site-packages/cherrypy/lib/autoreload.py", line 9, in
    import thread
ImportError: No module named thread

[1]    Exit 1                        SABnzbd.py --server 192.168.69.2:13077 --browser 0 --logging 0 --weblogging 0  ...


I have the cheerypy port installed....  :-\

bsss# pkg_version -v | grep -i sab
sabnzbdplus-0.4.11                  =  up-to-date with port

and....

bsss# pkg_version -v | grep -i py
py25-cElementTree-1.0.5_1          =  up-to-date with port
py25-chardet-1.0.1                  =  up-to-date with port
py25-cheetah-2.2.1                  =  up-to-date with port
py25-cherrypy-old-2.3.0,1          =  up-to-date with port
py25-elementtree-1.2.6_1            =  up-to-date with port
py25-feedparser-4.1_2              =  up-to-date with port
py25-openssl-0.8_1                  =  up-to-date with port
py25-orbit-2.24.0                  =  up-to-date with port
py25-setuptools-0.6c9              =  up-to-date with port
py25-utils-0.3.0                    =  up-to-date with port
py25-xml-0.8.4_1                    =  up-to-date with port
python25-2.5.4_2                    =  up-to-date with port
xdpyinfo-1.0.3                      =  up-to-date with port

Any ideas!?!?

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 20th, 2009, 2:52 pm
by shypike
I don't know where you got the SABnzbd package, but it obviously isn't correct.

The tarball that we distribute contains its own CherryPy package, so that we don't depend
on a potentially incompatible version of CherryPy (the CherryPy developers are very good
at breaking compatibility).

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 20th, 2009, 5:23 pm
by silkie
Bugger, I'll notify the ports maintainer for FreeBSD! :o( Shame......  ???

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 21st, 2009, 1:47 am
by switch
This is nothing to do with CherryPy, or even SABnzbd. Your python install does not contain the core module 'thread'. I would look into reinstalling python.

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 23rd, 2009, 3:05 am
by eydaimon
I'm the package maintainer for FreeBSD, and yes, as Switch says, I would have a look at the python installation to make sure it has been compiled with threads.

@shypike: FYI, the FreeBSD version is set to have a package dependency on a compatible version of CherryPy. This is not the issue.

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 23rd, 2009, 6:23 am
by silkie
riiiiiight...... things are getting very messy!

I have python 2.6 and 2.5 installed and I have circumvented the original message. Now I get: -
Sorry, requires Python module Cheetah 2.0rc7 or higher.


........but installing that module is easier said than done as there seems to be an issue installing the same port for cheetah into each python environment. The ports scripts keep complaining about the module being installed already.

I can't revert to a single instance of python as my WM (xfce) now depends on python2.6 :(

I'm getting confused going around in circles with this so I'm going to drop it for a while and revisit with a clear mind.

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 23rd, 2009, 6:34 am
by eydaimon
I don't have the makefile in front of me (as I said I have no access to a fbsd machine until septembner), but is there a dependency on python2.6 in there?
You should be able to get it to work with python 2.6 only, unless there are dependencies on other libraries which are only avail for 2.5.

The other thing you can do is pkg_info -L to see the package contents, and then just copy over those libs to 2.6

Maybe you can attach it here or paste it to pastie.org or something.

and there's always Fluxbox :)

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 23rd, 2009, 7:43 am
by shypike
eydaimon wrote: @shypike: FYI, the FreeBSD version is set to have a package dependency on a compatible version of CherryPy. This is not the issue.
1)
0.4.11 is not compatible with Python 2.6.
There are problems in several third-party modules.

2)
You should not use an installed CherryPy package, but the one that comes with SABnzbd.
(Although for 0.4.11 the latest 2.* will do fine).
The problems is that CherryPy releases have both forward and backward compatibility problems.
I know it's a pain, but that's just the way it is with CherryPy.
For 0.5.0 we are using an SVN snapshot, while waiting for 3.2.

3) Cheetah can be installed manually from it's tarball.
You may not be able to compile the _namemapper.pyd file, but SABnzbd will work without it.

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 23rd, 2009, 10:20 am
by silkie
CRACKED IT!!!!!!

OK this is what I did for anyone reading this who is getting stuck :)

I binned the meta port 'python'
installed python 2.6 for xfce and some other GTK bits I like that depended on 2.6. Build those bits with python 2.5 installed.

then i installed python 2.5

then before installing sabnzbd I had to issues `setenv PYTHON_VERSION python2.5` - THANKS ----> http://blog.e-shell.org/35

than i did the normal make on the sabnzb port forcing it to build everything on the version 2.5 python instance.

repeat for any other instances python modules that require 2.5.

Bingo!

Hope this helps someone out there........ Maybe we could set the title to something more appropriate? 'Fresh FreeBSD install and Python instance conflict resolution'....... for instance?

cheers for you help guys and eydaimon - I hope it doesn't mean much work for port.

:)

Re: FreeBSD: Installation Problems: Cherrpy Import Errors

Posted: July 23rd, 2009, 11:18 am
by eydaimon
silkie wrote: cheers for you help guys and eydaimon - I hope it doesn't mean much work for port.

:)
I don't think there's that much work to do at all. I'm not sure if there's any other way to specify what version of python to install for other than the way you did it. That's what I said in email, I knew there was a way, but  I couldn't remember off the top of my head.

I'm glad you got it sorted though :)