ImportError: No module named message

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Tuurbo
Newbie
Newbie
Posts: 5
Joined: January 20th, 2010, 3:17 pm

ImportError: No module named message

Post by Tuurbo »

Version: 0.5.2 RC1
OS: CentOS 5.4
Install-type: OSx source
Python version: Python 2.4.3
Firewall Software: None
Are you using IPV6? No
Is the issue reproducible? Yes

I'm running SABnzbd 0.5.0 smoothly on my CentOS system. Problem is when I want to upgrade to 0.5.2 RC1 is get this error;

Code: Select all

Traceback (most recent call last):
  File "/usr/share/SABnzbd/SABnzbd.py", line 63, in ?
    import sabnzbd
  File "/usr/share/SABnzbd/sabnzbd/__init__.py", line 66, in ?
    import sabnzbd.nzbqueue as nzbqueue
  File "/usr/share/SABnzbd/sabnzbd/nzbqueue.py", line 37, in ?
    import sabnzbd.assembler
  File "/usr/share/SABnzbd/sabnzbd/assembler.py", line 40, in ?
    import sabnzbd.postproc
  File "/usr/share/SABnzbd/sabnzbd/postproc.py", line 41, in ?
    import sabnzbd.emailer as emailer
  File "/usr/share/SABnzbd/sabnzbd/emailer.py", line 212, in ?
    from email.message import Message
ImportError: No module named message
I'm starting SAB by commandline

Code: Select all

python /usr/share/SABnzbd/SABnzbd.py -s 192.168.0.3:8001 -f sabnzbd.ini --browser 0 -d
Has anybody got an idea what's going wrong?
Last edited by Tuurbo on May 1st, 2010, 4:21 am, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: ImportError: No module named message

Post by shypike »

Did you install the new version over the old one?
Don't do that!
Remove the file email.py from the installation.
Tuurbo
Newbie
Newbie
Posts: 5
Joined: January 20th, 2010, 3:17 pm

Re: ImportError: No module named message

Post by Tuurbo »

I always remove the complete SABnzbd directory and place a new one.
I check just to be sure, but there's no file 'email.py' present.

[UPDATE]
If I copy the email.py from 0.5.0 to 0.5.2 RC1 and rename it to emailer.py the error message is gone.

The main diffence between the old (email.py) and new (emailer.py) file i could quickly detect is around line 212:

Code: Select all

from email.message import Message
from email.header import Header
from email.encoders import encode_quopri
RE_HEADER = re.compile(r'^([^:]+):(.*)')
Could it be that my Python isn't configured correct?
Last edited by Tuurbo on May 1st, 2010, 4:52 am, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: ImportError: No module named message

Post by shypike »

Either the email.py file is hiding the standard Python email module
or your Python misses the email module altogether.
Using the old email module is not a good idea.
lordmatanza
Newbie
Newbie
Posts: 2
Joined: May 3rd, 2010, 12:31 pm

Re: ImportError: No module named message

Post by lordmatanza »

I'm having the same problem and have no clue how to fix it.

I'm running CentOS 5.4
Tuurbo
Newbie
Newbie
Posts: 5
Joined: January 20th, 2010, 3:17 pm

Re: ImportError: No module named message

Post by Tuurbo »

I've try'd to solve the problem, but was unsuccessful.

Now back to SABnzbd version 0.5.0
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: ImportError: No module named message

Post by shypike »

The cause is that we don't test on Python 2.4 anymore.
The email library in 2.4 is a bit different.

I cannot guarantee that email still functions, but you can edit the file emailer.py.
Changes these lines:

Code: Select all

from email.message import Message
from email.header import Header
from email.encoders import encode_quopri
to

Code: Select all

from email.Message import Message
from email.Header import Header
from email.Encoders import encode_quopri
At least SABnzbd will now startup.

I find it hard to take an OS like CentOS serious.
Python 2.5 was released end of 2006.
We're talking about a mainstream OS, not some specialty embedded device.
Last edited by shypike on May 3rd, 2010, 3:51 pm, edited 1 time in total.
lordmatanza
Newbie
Newbie
Posts: 2
Joined: May 3rd, 2010, 12:31 pm

Re: ImportError: No module named message

Post by lordmatanza »

That did it...

I know about the 'age' of CentOS and I agree that it's shamefull that it still uses python 2.4, but the main advantage why I use it is that it's super stable and extremely well tested (it's basically RHEL).
I used to use Fedora, but got sick of installing my machine every 13 months because the life cycle ended.
But this is a whole other discussion not for this forum ;)

Thnx for you help!
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: ImportError: No module named message

Post by shypike »

It's probably fixable.
The differences cannot be very big, because it's only some email classes.
As soon as I have a VMWare session with Python 2.4 running, it should be easy to check.
At some point we will need to drop Python 2.4 and 2.5, because they keep us
from migrating to a full Unicode app.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: ImportError: No module named message

Post by shypike »

The fix is indeed trivial.
Just download the attachment of this announcement: http://forums.sabnzbd.org/http://forums ... 782#p30782
Tuurbo
Newbie
Newbie
Posts: 5
Joined: January 20th, 2010, 3:17 pm

Re: ImportError: No module named message

Post by Tuurbo »

It works! :)

Wanted to thank you for the extra service for we Python 2.4 users. Maybe i'll switch in the future to an other distro, but that's an other discussion.

This topic can be locked.
Bascy
Newbie
Newbie
Posts: 8
Joined: January 19th, 2009, 4:10 pm

Re: ImportError: No module named message

Post by Bascy »

Just installed 0.5.2 on Freenas with Python 25 installed and having the same problems!

Will try the fix from the other thread, but just wanted to let you know that it also exists in python 2.5

Edit: Installed the fix, but still the same error. Although i am a progammer, I'v never done anything with python ... but i'll try to fix this

I got the following python packages installed ... am i missing something?

Code: Select all

py25-chardet-1.0.1  Character encoding auto-detection in Python
py25-cheetah-2.0.1  HTML template engine for Python
py25-cherrypy-3.1.1 A pythonic, object-oriented web development framework
py25-elementtree-1.2.6 Container for hierarchical data structures written in Pytho
py25-feedparser-4.1_2 An RSS feed parser written in Python
py25-openssl-0.8_1  Python interface to the OpenSSL library
py25-setuptools-0.6c9 Download, build, install, upgrade, and uninstall Python pac
py25-sqlite3-2.5.4_1 Standard Python binding to the SQLite3 library
py25-utils-0.3.0    General utility modules that simplify common programming in
python25-2.5.4_1    An interpreted object-oriented programming language
Last edited by Bascy on May 4th, 2010, 2:47 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: ImportError: No module named message

Post by shypike »

You did not install release 0.5.2Final over any old version, did you?
If so, remove the file sabnzbd/email.py

Otherwise you have a lousy Python on your system.
Bascy
Newbie
Newbie
Posts: 8
Joined: January 19th, 2009, 4:10 pm

Re: ImportError: No module named message

Post by Bascy »

Yep, that was the problem.

I did try installing Python 2.6 but couldnt find all the packages needed. Have they changed all that in 2.6?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: ImportError: No module named message

Post by shypike »

The email modules should be included in each standard source distribution.
SABnzbd works fine with a properly installed Python 2.6.
The only required third-party module is Cheetah.
PyOpenSSL and yEnc are optional (but I wouldn't leave out yEnc).
Post Reply