wakatime/wakatime-cli

Wakatime not working on Fish terminal on Fedora Linux

david-kariuki opened this issue · 4 comments

Expected behavior (what should have happened):
Run fish terminal with wakatime configured

Actual behavior (what went wrong):
I have tried running fish with wakatime configured but I keep getting errors.
I have installed wakatime, golang and python. I don't know if I'm missing out on something. However, this does not happen with root or sudo priviledges.

Environment:

  • OS: Fedora 37
  • Platform: amd64

Contents of wakatime.cfg config file

[settings]
api_key = waka_************* <- ERASED
proxy =
debug = false
status_bar_enabled = true


hide_file_names = true
hide_project_names = true
hide_branch_names = true
hide_project_folder = true

Contents of my fish_prompt.fish file (~/.config/fish/functions/fish_prompt.fish)

# wakatime for fish
#
# Add this to the fish_prompt function in
# ~/.config/fish/functions/fish_prompt.fish
# (or if it doesn't exist, create it).


# We've also included an example of how
# to determine the current project from the pwd.
# It'll only work without alterations if
# you happen to keep all your projects in
# ~/Sites/ on a Mac, but it's easy to modify

set -l project

if echo (pwd) | grep -qEi "^/Users/$USER/Sites/"
    set  project (echo (pwd) | sed "s#^/Users/$USER/Sites/\\([^/]*\\).*#\\1#")
else
    set  project "Terminal"
end

wakatime --write --plugin "fish-wakatime/0.0.1" --entity-type app --project "$project" --entity (echo $history[1] | cut -d ' ' -f1) 2>&1 > /dev/null&

Logs:

Below is the error I'm getting on my terminal when I try to start Fish

 File "/usr/local/bin/wakatime", line 5, in <module>
    from wakatime.__init__ import execute
  File "/usr/local/lib/python3.11/site-packages/wakatime/__init__.py", line 17, in <module>
    from .main import execute
  File "/usr/local/lib/python3.11/site-packages/wakatime/main.py", line 32, in <module>
    from .api import send_heartbeats, get_time_today
  File "/usr/local/lib/python3.11/site-packages/wakatime/api.py", line 22, in <module>
    from .session_cache import SessionCache
  File "/usr/local/lib/python3.11/site-packages/wakatime/session_cache.py", line 26, in <module>
    from .packages import requests
  File "/usr/local/lib/python3.11/site-packages/wakatime/packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/usr/local/lib/python3.11/site-packages/wakatime/packages/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/usr/local/lib/python3.11/site-packages/wakatime/packages/urllib3/connectionpool.py", line 29, in <module>
    from .connection import (
  File "/usr/local/lib/python3.11/site-packages/wakatime/packages/urllib3/connection.py", line 39, in <module>
    from .util.ssl_ import (
  File "/usr/local/lib/python3.11/site-packages/wakatime/packages/urllib3/util/__init__.py", line 3, in <module>
    from .connection import is_connection_dropped
  File "/usr/local/lib/python3.11/site-packages/wakatime/packages/urllib3/util/connection.py", line 3, in <module>
    from .wait import wait_for_read
  File "/usr/local/lib/python3.11/site-packages/wakatime/packages/urllib3/util/wait.py", line 1, in <module>
    from .selectors import (
  File "/usr/local/lib/python3.11/site-packages/wakatime/packages/urllib3/util/selectors.py", line 14, in <module>
    from collections import namedtuple, Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib64/python3.11/collections/__init__.py)