kazam icon indicating copy to clipboard operation
kazam copied to clipboard

Kazam not working on Python 3.5.3

Open SebaDA opened this issue 7 years ago • 11 comments

It seems tha Kazam is not working on Python 3.5

$ python3 -V
Python 3.5.3

Steps:

  1. Download kazam from https://launchpad.net/kazam/stable/1.4.5/+download/kazam-1.4.5.tar.gz
  2. Unpack
  3. Install with:
sudo python3 setup.py install
  1. Run kazam
$ kazam
/usr/bin/kazam:32: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
Traceback (most recent call last):
  File "/usr/bin/kazam", line 146, in <module>
    from kazam.app import KazamApp
  File "/usr/lib/python3.5/site-packages/kazam/app.py", line 35, in <module>
    from kazam.backend.prefs import *
  File "/usr/lib/python3.5/site-packages/kazam/backend/prefs.py", line 478, in <module>
    prefs = Prefs()
  File "/usr/lib/python3.5/site-packages/kazam/backend/prefs.py", line 121, in __init__
    self.read_config()
  File "/usr/lib/python3.5/site-packages/kazam/backend/prefs.py", line 199, in read_config
    self.audio_source = int(self.config.get("main", "audio_source"))
  File "/usr/lib/python3.5/site-packages/kazam/backend/config.py", line 103, in get
    return ConfigParser.get(self, section, key)
  File "/usr/lib64/python3.5/configparser.py", line 797, in get
    d)
  File "/usr/lib64/python3.5/configparser.py", line 393, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib64/python3.5/configparser.py", line 406, in _interpolate_some
    rawval = parser.get(section, option, raw=True, fallback=rest)
TypeError: get() got an unexpected keyword argument 'raw'

SebaDA avatar Jun 30 '17 07:06 SebaDA

My problem too...'

kholyphoenix1 avatar Oct 29 '17 20:10 kholyphoenix1

I am seeing the same problem on Ubuntu 17.10:

λ Neutron ~ → python3 -V
Python 3.6.3 λ Neutron ~ → kazam -v /usr/bin/kazam:32: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded. from gi.repository import Gtk kazam 1.4.5 'NCC-80102' λ Neutron ~ → kazam /usr/bin/kazam:32: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded. from gi.repository import Gtk /usr/lib/python3/dist-packages/kazam/frontend/window_area.py:30: PyGIWarning: Wnck was imported without specifying a version first. Use gi.require_version('Wnck', '3.0') before import to ensure that the right version gets loaded. from gi.repository import Gtk, GObject, Gdk, Wnck, GdkX11 /usr/lib/python3/dist-packages/kazam/backend/gstreamer.py:35: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded. from gi.repository import GObject, Gst /usr/lib/python3/dist-packages/kazam/frontend/indicator.py:148: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded. from gi.repository import AppIndicator3 /usr/lib/python3/dist-packages/kazam/frontend/indicator.py:97: PyGIWarning: Keybinder was imported without specifying a version first. Use gi.require_version('Keybinder', '3.0') before import to ensure that the right version gets loaded. from gi.repository import Keybinder [1] 7891 segmentation fault (core dumped) kazam λ Neutron ~ → cat /etc/lsb-release
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=17.10 DISTRIB_CODENAME=artful DISTRIB_DESCRIPTION="Ubuntu 17.10"

RaviTezu avatar Nov 02 '17 17:11 RaviTezu

+1

thiagozs avatar Nov 07 '17 03:11 thiagozs

On Ubuntu 17.10: I switched to Xorg at the login prompt and everything started working fine then after.

RaviTezu avatar Nov 07 '17 04:11 RaviTezu

/usr/bin/kazam:32: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded. ...blah blah blah...

Open file

/usr/lib/python3/dist-packages/kazam/backend/config.py

find

def get(self, section, key): try: ret = ConfigParser.get(self, section, key)

and replace

def get(self, section, key,raw=True,fallback='rest'): try: return super(KazamConfig,self).get(section, key,raw=raw,fallback=fallback) ret = ConfigParser.get(self, section, key)

Try start Kazam.

pojar avatar Nov 23 '17 18:11 pojar

+1

Ubuntu 17.10, x64, Python 2.7.14

maximal avatar Dec 25 '17 08:12 maximal

@RaviTezu, seems like your error is not the same as the @SebaDA’s one (but I’m not sure, of course).

The surgical solution for you is in my answer to this StackExchange question:

https://askubuntu.com/questions/982233/kazam-fails-with-pygiwarning-gtk-was-imported-without-specifying-a-version-fir/989341#989341

maximal avatar Dec 25 '17 09:12 maximal

Another solution is to modify the function prototype to pass extra arguments:

def get(self, section, key,raw=True,fallback='rest',**kwargs):

Then forward extra kwargs in the call:

ret = ConfigParser.get(self, section, key, **kwargs)

And per the previous suggestion I would simplify:

ret = super().get(self, section, key, **kwargs)

The additional arguments are not necessary for python 3. Both approaches are equivalent. The only advantage here is to avoid having to fix the same problem if the parameters change in the future.

cutephoton avatar Jan 02 '18 04:01 cutephoton

@cutephoton Nice fix! Why didn't you ask for a pull request?

gustavklopp avatar Sep 29 '18 14:09 gustavklopp

Yeah, sorry about that -- I needed kazam for a project at the time and forgot about the fix. Looks like there's a pull request with a similar fix as of the last week.

Thank you for the positive feedback.

cutephoton avatar Oct 08 '18 03:10 cutephoton

JUST ADDING **KWARGS TO THE PARAMETERS WILL SOLVE THE PROBLEM.

1-Open file

/usr/lib/python3/dist-packages/kazam/backend/config.py

or

/usr/local/lib/python3.6/dist-packages/kazam/backend/config.py

2-Find this function

def get(self, section, key):

and replace

def get(self, section, key,**kwargs):

3-Find this return line

return ConfigParser.get(self, section, key)

and replace

return ConfigParser.get(self, section, key,**kwargs)

OsmanKandemir avatar Mar 21 '21 14:03 OsmanKandemir