omemo / gajim-omemo

Gajim plugin for OMEMO Multi-End Message and Object Encryption
86 stars 7 forks source link

Warning: You are missing the Setuptools package. #141

Closed rugk closed 7 years ago

rugk commented 7 years ago

General information

Before opening an issue, please read our Wiki

What's wrong

I installed gajim and from Debian's jessie-backports. Now I cannot activate the plugin, because it claims in the plugin dialog that the setuptools package is missing:

Warning: You are missing the Setuptools package.

However python-setuptools is certainly installed:

$ apt-cache show python-setuptools 
Package: python-setuptools
Version: 20.10.1-1.1~bpo8+1

I also tried to install this plugin via the internal plugin downloader of gajim, but the result is the same.

Debug output

$ gajim -l gajim.plugin-system.omemo=DEBUG                  
Logger gajim.plugin-system.omemo level set to 10
[~]/.local/share/gajim/plugins/gotr/ui.py:40: GtkWarning: Unknown property: GtkMenu.ubuntu-local
  self.B.add_from_file(self.GTK_BUILDER_FILE_PATH)
somedate xx:yy:zz (E) gajim.plugin_system.omemo 'utf8' codec can't decode byte 0xb6 in position 147: invalid start byte in /usr/lib/pymodules/python2.7/rpl-1.5.5.egg-info
lovetox commented 7 years ago

could you try to type this into a python console

__import__('pkg_resources')

lovetox commented 7 years ago

try installing python-pkg-resources

rugk commented 7 years ago

The latter is already installed:

Package: python-pkg-resources
Source: python-setuptools
Version: 20.10.1-1.1~bpo8+1

could you try to type this into a python console

I can do, but after starting gajim from the Python console via os.system, the error still happens.

lovetox commented 7 years ago

no dont start gajim, just tell me what error you get if you type that into the console

__import__('pkg_resources')

rugk commented 7 years ago
$ python3
Python 3.4.2 (default, Oct  8 2014, 10:45:20) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> __import__('pkg_resources')
<module 'pkg_resources' from '/usr/lib/python3/dist-packages/pkg_resources/__init__.py'>
lovetox commented 7 years ago

Gajim, is a Python2 application, please make sure that the package is also installed for python2

rugk commented 7 years ago
$ python2                               
Python 2.7.9 (default, Jun 29 2016, 13:08:31) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> __import__('pkg_resources')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 626, in _build_master
    ws = cls()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 619, in __init__
    self.add_entry(entry)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 675, in add_entry
    for dist in find_distributions(entry, True):
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1982, in find_on_path
    path_item, entry, metadata, precedence=DEVELOP_DIST
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2370, in from_location
    py_version=py_version, platform=platform, **kw
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2687, in _reload_version
    md_version = _version_from_file(self._get_metadata(self.PKG_INFO))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2335, in _version_from_file
    line = next(iter(version_lines), '')
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2503, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1873, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1863, in get_metadata
    metadata = f.read()
  File "/usr/lib/python2.7/codecs.py", line 296, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb6 in position 147: invalid start byte in /usr/lib/pymodules/python2.7/rpl-1.5.5.egg-info

However, as shown above python-setuptools (& python3-setuptools) is installed.

rugk commented 7 years ago

Also this fails:

$ easy_install                                      
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 626, in _build_master
    ws = cls()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 619, in __init__
    self.add_entry(entry)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 675, in add_entry
    for dist in find_distributions(entry, True):
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1982, in find_on_path
    path_item, entry, metadata, precedence=DEVELOP_DIST
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2370, in from_location
    py_version=py_version, platform=platform, **kw
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2687, in _reload_version
    md_version = _version_from_file(self._get_metadata(self.PKG_INFO))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2335, in _version_from_file
    line = next(iter(version_lines), '')
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2503, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1873, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1863, in get_metadata
    metadata = f.read()
  File "/usr/lib/python2.7/codecs.py", line 296, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb6 in position 147: invalid start byte in /usr/lib/pymodules/python2.7/rpl-1.5.5.egg-info

(whereas easy_install3 works)

rugk commented 7 years ago

In /usr/lib/pymodules/python2.7/rpl-1.5.5.egg-info there is just:

Metadata-Version: 1.0
Name: rpl
Version: 1.5.5
Summary: Free replacement for rpl (replace strings in files).
Home-page: http:/rpl.sf.net
Author: Go�ran Weinholt
Author-email: weinholt@debian.org
License: GPL v2 or later
Description: UNKNOWN
Platform: UNKNOWN

Actually the special character there caused the issue. After editing the file and removing this char, everything worked. :smiley: Thanks for your help.

lovetox commented 7 years ago

yeah galde to hear, but i would report this to the RPL devs

cippaciong commented 7 years ago

Someone took care already: https://sourceforge.net/p/rpl/bugs/2/

rugk commented 7 years ago

Actually I already found error reports about this: https://github.com/pypa/setuptools/issues/719