katrain icon indicating copy to clipboard operation
katrain copied to clipboard

Python 3.10 issues

Open adhalanay opened this issue 3 years ago • 7 comments

When I try to load a file in katrain with CTRL-L the file list is empty, also I cannot change the folder. In the info window I get the following error:

ERROR: Exception AttributeError: "module 'collections' has no attribute 'Callable'" File "kivy/_clock.pyx", line 645, in kivy._clock.CyClockBase._process_events File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick File "/usr/lib/python3.10/site-packages/kivy/uix/filechooser.py", line 711, in _update_files if self._create_files_entries(): File "/usr/lib/python3.10/site-packages/kivy/uix/filechooser.py", line 731, in _create_files_entries index, total, item = next(self._gitems_gen) File "/usr/lib/python3.10/site-packages/kivy/uix/filechooser.py", line 852, in _generate_file_entries for index, total, item in self._add_files(path): File "/usr/lib/python3.10/site-packages/kivy/uix/filechooser.py", line 879, in _add_files files = self._apply_filters(files) File "/usr/lib/python3.10/site-packages/kivy/uix/filechooser.py", line 668, in _apply_filters if isinstance(filt, collections.Callable):

My system is Arch Linux with kernel 5.15.13-arch1-1 Python version 3.9

adhalanay avatar Jan 12 '22 17:01 adhalanay

Looks like python 3.10 - and kivy doesn't seem very happy with it in several ways. I've submitted a fix for this particular thing, but it might take a while to be fully compatible. In the mean time, I recommend using a py3.8 or 3.9 based venv.

sanderland avatar Jan 13 '22 08:01 sanderland

Another python 3.10 issue reported on discord was:

ImportError: "/home/b2/katrain/lib/python3.10/site-packages/kivy/_event.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send

sanderland avatar Jan 13 '22 08:01 sanderland

I can confirm that running in a virtual environment with python 3.9 solves the problem. So I think the problem lies with kivy. I think you can close the bug here.

adhalanay avatar Jan 13 '22 13:01 adhalanay

Another 3.10 issue

❯ pip install -U katrain
Defaulting to user installation because normal site-packages is not writeable
Collecting katrain
  Downloading KaTrain-1.10.1-py3-none-any.whl (62.8 MB)
     |████████████████████████████████| 62.8 MB 51.7 MB/s            
Collecting kivymd==0.104.1
  Using cached kivymd-0.104.1-py3-none-any.whl (2.4 MB)
Requirement already satisfied: chardet in /usr/lib/python3.10/site-packages (from katrain) (4.0.0)
Collecting screeninfo
  Downloading screeninfo-0.8-py3-none-any.whl (14 kB)
Collecting kivy[full]>=2.0.0
  Downloading Kivy-2.0.0.tar.gz (23.7 MB)
     |████████████████████████████████| 23.7 MB 4.9 MB/s            
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: wheel in /usr/lib/python3.10/site-packages (from katrain) (0.37.1)
Requirement already satisfied: setuptools in /usr/lib/python3.10/site-packages (from katrain) (57.4.0)
Collecting ffpyplayer
  Downloading ffpyplayer-4.3.2.tar.gz (86 kB)
     |████████████████████████████████| 86 kB 10.9 MB/s            
Requirement already satisfied: urllib3 in /usr/lib/python3.10/site-packages (from katrain) (1.26.7)
Requirement already satisfied: pillow in /usr/lib/python3.10/site-packages (from kivymd==0.104.1->katrain) (8.4.0)
Requirement already satisfied: requests in /usr/lib/python3.10/site-packages (from kivymd==0.104.1->katrain) (2.26.0)
Requirement already satisfied: docutils in /usr/lib/python3.10/site-packages (from kivy[full]>=2.0.0->katrain) (0.16)
Collecting Kivy-Garden>=0.1.4
  Using cached kivy-garden-0.1.4.tar.gz (6.8 kB)
Requirement already satisfied: pygments in /usr/lib/python3.10/site-packages (from kivy[full]>=2.0.0->katrain) (2.10.0)
Requirement already satisfied: idna>=2.5 in /usr/lib/python3.10/site-packages (from requests->kivymd==0.104.1->katrain) (3.3)
Building wheels for collected packages: kivy, Kivy-Garden, ffpyplayer
  Building wheel for kivy (PEP 517) ... done
  Created wheel for kivy: filename=Kivy-2.0.0-cp310-cp310-linux_x86_64.whl size=24988744 sha256=73f93f5c678625e70baadfa2c6f7e7d19b0f33e21ff4bee9035f35ad7bd558a3
  Stored in directory: /home/user/.cache/pip/wheels/45/4e/04/46ac8a017ea99f8f0a1cc6247aaaf218798b656b10c7fb33f7
  Building wheel for Kivy-Garden (setup.py) ... done
  Created wheel for Kivy-Garden: filename=Kivy_Garden-0.1.4-py3-none-any.whl size=4531 sha256=56ebfbc2e9cfc2e88f2178336e6bfa1216177e422fc71617c6daf0e49aaebe20
  Stored in directory: /home/user/.cache/pip/wheels/a4/86/c8/90287c449d17c86c8947821960f9dd990064a314cc0e60f915
  Building wheel for ffpyplayer (setup.py) ... done
  Created wheel for ffpyplayer: filename=ffpyplayer-4.3.2-cp310-cp310-linux_x86_64.whl size=2709187 sha256=b90d4a2f33727d734b8dcb98b42f6512f223b593b2fa203b3b145055f2598296
  Stored in directory: /home/user/.cache/pip/wheels/94/29/bc/dcdaacffe1c207438306078d629f33662756c2a672266c2b07
Successfully built kivy Kivy-Garden ffpyplayer
Installing collected packages: Kivy-Garden, kivy, ffpyplayer, screeninfo, kivymd, katrain
Successfully installed Kivy-Garden-0.1.4 ffpyplayer-4.3.2 katrain-1.10.1 kivy-2.0.0 kivymd-0.104.1 screeninfo-0.8

~ took 2m15s 
❯ katrain               
 Traceback (most recent call last):
   File "/home/user/.local/bin/katrain", line 5, in <module>
     from katrain.__main__ import run_app
   File "/home/user/.local/lib/python3.10/site-packages/katrain/__main__.py", line 36, in <module>
     from kivy.base import ExceptionHandler, ExceptionManager
   File "/home/user/.local/lib/python3.10/site-packages/kivy/base.py", line 29, in <module>
     from kivy.event import EventDispatcher
   File "/home/user/.local/lib/python3.10/site-packages/kivy/event.py", line 8, in <module>
     import kivy._event
 ImportError: /home/user/.local/lib/python3.10/site-packages/kivy/_event.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send

Using a 3.9 venv solves all the issues for now

   pyenv install 3.9.7
    pyenv shell 3.9.7
    pip3 install -U katrain
    # install kivy from source
    git clone git://github.com/kivy/kivy.git
    cd kivy
    python -m pip install -e ".[dev,full]"

sanderland avatar Jan 21 '22 19:01 sanderland

Does 1.11 work?

sanderland avatar Mar 31 '22 07:03 sanderland

The packaged version still has the same problem. That installed in a venv is working good.

adhalanay avatar Mar 31 '22 14:03 adhalanay

Potentially resolved? Should look into allowing 3.10 again in 1.11.3

sanderland avatar Aug 26 '22 12:08 sanderland

3.10 appears working

sanderland avatar Oct 10 '22 12:10 sanderland