1

I have installed python jabber package from this url http://sourceforge.net/projects/jabberpy/files/

But when i am importing i am still getting the following error.

>>> import jabber
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named jabber

i am using python 2.7.5, jabberpy 0.5 How to overcome this..? Thanks in advance

Mulagala
  • 6,713
  • 10
  • 23
  • 45

1 Answers1

1

jabberpy 0.5 does not include __init__.py file and as such, is not detected as a package. I don't know why that is take case. My guess is that earlier versions of Python __init__.py was not required, which would explain why its not included in jabberpy.

You can work around this problem by manually creating empty __init__.py file under the location your module install (probably something like /usr/lib/python2.7/site-packages/jabber)

If you don't want to touch the jabberpy module, you can also include the install location of your module before loading it:

import sys
sys.path.append('/usr/lib/python2.7/site-packages/jabber')

import jabber

Both of the workarounds are ugly. I would just probably take a look at alternative, fresher Jabber libraries that don't have this problem in the first place.

Community
  • 1
  • 1
jsalonen
  • 26,663
  • 14
  • 82
  • 104
  • jsalonen, I am using fedora 20, and i downloaded the last version of jabber that is 0.5 – Mulagala May 19 '14 at 06:05
  • 1
    Edited the answer to use Linux paths. I know you are using latest jabberpy. What I'm saying is that you should use some other library instead. – jsalonen May 19 '14 at 06:09
  • 1
    @Mulagala: it depends on where you have installed Python and which is the site-packages folder you are installing your module into. Just locate the module and change the path accordingly :) – jsalonen May 19 '14 at 06:10