liloman / pomodoroTasks2

Systray app for pomodoro with taskwarrior
GNU General Public License v3.0
34 stars 6 forks source link

Tasklib not found? #1

Closed catalin852 closed 7 years ago

catalin852 commented 7 years ago

Hello, I have installed the tasklib, taskwarrior and timewarrior, but when I am trying to execute the pomodoro daemon, I get this error: ~/.local/bin $ ./pomodoro-daemon.py Traceback (most recent call last): File "./pomodoro-daemon.py", line 6, in <module> from tasklib import TaskWarrior, Task ImportError: No module named tasklib Any idea how to fix it? I am not familiar with python scripts :/

liloman commented 7 years ago

Don't worry it's my first python project too but it works. :P

Did you try this?

pip install tasklib --user

This will install with the python software manager the tasklib library.

For timewarrior I use several solutions. 1-When I suspend the computer its stop the current task, so no gaps in summary (see 2)... :) https://github.com/liloman/dotfiles/blob/master/systemd/.config/systemd/user/on-logout.service

2-Every time a task is stopped/started the time is tracked with timewarrior (see 1). https://github.com/liloman/warriors/blob/master/on-modify.timewarrior

3-You can track you shutdown time too if you want it (I don't recommend it if you want to sync your tasks and track several computers)

https://github.com/liloman/warriors/blob/master/last-boots.sh

I have to document these steps cause they are the cause of integrating timewarrior.

If you're new to taskwarrior/timewarrior take your time to familiarize and integrate your workflow with them. ;)

You will see how can track any single task in your computer. :)

catalin852 commented 7 years ago

I have installed the tasklib using that command, yes. Taskwarrior works fine with Timewarrior, I just get the above error when trying to run your script. Is it supposed to work out of the box, given the fact that tasklib is already present on the system?

liloman commented 7 years ago

I just tried it with ubuntu lxde.

vagrant init janihur/ubuntu-1604-lxde-desktop
vagrant up 

Enter vagrant/vagrant in gui:

sudo apt install git taskwarrior python-pip cmake
pip install tasklib --user
git clone --recursive https://git.tasktools.org/scm/tm/timew.git timew.git
cd timew.git
git checkout master 
cmake -DCMAKE_BUILD_TYPE=release .
make
sudo make install
cd
task (create dir)

And now just execute it:

git clone https://github.com/liloman/pomodoroTasks2
cd pomodoroTasks2/
./pomodoro-daemon.py

And I just discovered that I have required GTK 3.20 in the glade file for change task gui so just changed it to 3.0 and everything working.

If you give me you distro I can try it without any problem with vagrant in a second.

By the way, that error is the python error for library not found, so it's clear that it doesn't found the tasklib library (taskwarrior library for python), maybe because you don't have pip installed?.

Cheers

catalin852 commented 7 years ago

Hi, thank you for your answer, I will look at it once I find some time. My distro is Linux Mint 17.3 Xfce edition but running Cinnamon desktop right now. I do have pip install. I will try it and get back to you.

liloman commented 7 years ago

Interesting:

vagrant init artem-sidorenko/mint-17.3-cinnamon
vagrant up
vagrant ssh
sudo apt-get install build-essential gcc-multilib task git python-pip cmake
pip install tasklib --user
git clone --recursive https://git.tasktools.org/scm/tm/timew.git timew.git
cd timew.git
git checkout master 
cmake -DCMAKE_BUILD_TYPE=release .

Timewarrior compilation fails cause outdated c++ compiler so:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9
sudo ln -f -s /usr/bin/g++-4.9 /usr/bin/g++
cmake -DCMAKE_BUILD_TYPE=release .
make
make install
cd
git clone https://github.com/liloman/pomodoroTasks2
cd pomodoroTasks2/
./pomodoro-daemon.py

And it just doesn't work properly for two reasons: 1-The builder requires of all objects to have a id ¿? (fixed but strange behaivour) 2-The dbus communication is broken cause linux mint don't use the standar /run/user/id/bus session bus path but /tmp/dbus*. (I'm gonna fix it too but It's already 2017...)

It's Interesing cause I hit 2 errors than I didn't found neither Fedora nor Ubuntu.

Cheers

catalin852 commented 7 years ago

Oh nice! Thank you. I will try it myself as well and let you know. I did not know that Mint does not use the standard bus.

liloman commented 7 years ago

Fixed the 2 issues.

Verbatim (from a fresh new VM, vagrant cache powa ;) ):

vagrant init artem-sidorenko/mint-17.3-cinnamon
vagrant up
vagrant ssh
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install build-essential task git python-pip cmake g++-4.9
sudo ln -f -s /usr/bin/g++-4.9 /usr/bin/g++
pip install tasklib --user
git clone --recursive https://git.tasktools.org/scm/tm/timew.git timew.git
cd timew.git
git checkout master 
cmake -DCMAKE_BUILD_TYPE=release .
make
sudo make install
cd
git clone https://github.com/liloman/pomodoroTasks2
task (yes to create dir)
timew (yes to create dir)

Gui login:vagrant/vagrant and open gnome terminal:

cd pomodoroTasks2/
./pomodoro-daemon.py

And ready to go! :)

catalin852 commented 7 years ago

I have some trouble with vagrant and virtualbox versions and can't get past this. Doesn't pomodoroTasks2 work without vagrant? Because I executed the commands (not the 3 vagrant cmds) and I get the same error.

liloman commented 7 years ago

Hi catalin852,

Vagrant is just a technology to test diferrent OS in your machine. I'm using Vagrant here just to test pomodoroTask2 on diferent OS (enviroments so) and verifying that works on those OS (ubuntu, mint...) like it does in Fedora (my OS).

I tried to install pomodoroTasks2 on Linux Mint 17.3 Cinammon (your OS/enviroment) and I was able to use pomodoroTasks2 without an issue as you can see in the post above yours.

Let' s see if you have tasklib installed, execute this and paste the output. ;)

pip show tasklib

Cheers

catalin852 commented 7 years ago

Hi liloman, after reinstalling my whole system (for another reason) I retried the steps. Everything went smoothly until I run the ./pomodoro-daemon.py, where I get a segfault. The icon in the system tray is shown for a bit and then it crashes. If I manage to click on it fast, it shows this error

Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) File "./pomodoro-systray.py", line 59, in _fsm print ("reply:"+self.interface.do_fsm(action)[0]) File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__ **keywords) File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking message, timeout) DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

liloman commented 7 years ago

What distro are you using?

The segfault issue is strange cause it's just python so there isn't low level stuff and I haven't had any meanwhile developed it.

That's "an error" that is shown when the daemon is closed. (I will fix today for a better message)

You seem to be out of luck with pomodoroTask. :S

catalin852 commented 7 years ago

Same as before, Linux Mint 17.3. Cinnamon version (before I had Xfce4 with Cinnamon installed as extra desktop). Yeah, maybe I am out of luck indeed, but it's ok :P. I am using the Pomodoro Timer applet for Cinnamon. It does my job.