insanum / sncli

Simplenote CLI
MIT License
396 stars 34 forks source link

Crashing with TypeError unorderable types on first run in Debian #30

Closed shankargopal closed 7 years ago

shankargopal commented 7 years ago

Thank you for all the work on this program!

I'm trying to get it installed in a Debian Jessie system that mostly runs packages from the testing repository (i.e. all the Python packages are from there). With some difficulty I managed to install it using pip3 install sncli (I had to separately install the python3-wheel, python3-urwid, python3-request and python3-setuptools packages to get it to even try to start).

I then created .snclirc and tried to run from my home directory. I get a white bar at the top of the terminal saying 'Simplenote" and then the program crashes with this stack trace:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.5/dist-packages/simplenote_cli/notes_db.py", line 632, in sync_worker
    self.sync_now(do_server_sync)
  File "/usr/local/lib/python3.5/dist-packages/simplenote_cli/notes_db.py", line 625, in sync_now
    full_sync=True if not self.last_sync else False)
  File "/usr/local/lib/python3.5/dist-packages/simplenote_cli/notes_db.py", line 428, in sync_notes
    self.log("Starting full sync")
  File "/usr/local/lib/python3.5/dist-packages/simplenote_cli/sncli.py", line 258, in log
    self.log_timeout, None)
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 165, in set_alarm_in
    return self.event_loop.alarm(sec, cb)
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 604, in alarm
    heapq.heappush(self._alarms, (tm, callback))
TypeError: unorderable types: function() < function()

Though this error occurs in the urwid module, it occurs whether I use the version from pip (pip3 install urwid) or from Debian (both testing and unstable repositories). So it seems like the error is in the code for sncli.

No one else seems to have this problem - have I done something wrong while installing the program? I'd love to use this.

samuelallan72 commented 7 years ago

I just attempted to install sncli myself on a Debian Jessie (lxc container since my computer is running Arch - it should still work the same though). This was from a clean base install and I was able to run it successfully with:

apt install python3-pip
pip3 install sncli
sncli

It ran fine and I didn't encounter your problem. I also ran pip uninstall urwid and apt install python3-urwid to use the system version instead, and no problems.

I would suggest checking exactly what packages are installed and whether things are conflicting - for python packages there could be versions installed by apt, globally with pip3, or per user with pip3. Try uninstalling sncli, requests, and urwid, both with pip and apt and make sure they are fully uninstalled by running python3 and ensuring that you get an import error on all the following imports:

import sncli
import urwid
import requests

Maybe even uninstall pip3 if possible. Then try the sequence of commands I mentioned earlier and see if it will work.

Something else interesting: your traceback looks like it's running python3.5 instead of the default python3.4 (afaik the default python3 in debian jessie). It would be interesting to note the output of pip3 --version and python3 --version.

EDIT: just realized you said you're using the testing repository... so python 3.5 is probably correct. perhaps the sncli script is somehow installed for python3.5 but trying to run on python3.4 or vice-verse. You can see what command is being used to run it by running cat $(which sncli) and checking the first line.

Let us know how you go. :)

shankargopal commented 7 years ago

And... that worked perfectly!

Thank you. My bad. I think I may have installed one of the dependencies in Python 2 instead of Python 3 (though those are separate paths, so I'm not sure how that created a problem, but anyway).

Thank you very much once again for making such a great program.

On Tue, 04 Oct 2016 00:34:01 -0700 Samuel Walladge notifications@github.com wrote:

I just attempted to install sncli myself on a Debian Jessie (lxc container since my computer is running Arch - it should still work the same though). This was from a clean base install and I was able to run it successfully with: ``` apt install python3-pip pip3 install sncli sncli

It ran fine and I didn't encounter your problem. I also ran `pip
uninstall urwid` and `apt install python3-urwid` to use the system
version instead, and no problems.

I would suggest checking exactly what packages are installed and
whether things are conflicting - for python packages there could be
versions installed by `apt`, globally with `pip3`, or per user with
`pip3`. Try uninstalling sncli, requests, and urwid, both with pip
and apt and make sure they are fully uninstalled by running python3
and ensuring that you get an import error on all the following
imports:

import sncli import urwid import requests

Maybe even uninstall pip3 if possible. Then try the sequence of
commands I mentioned earlier and see if it will work.

Something else interesting: your traceback looks like it's running
**python3.5** instead of the default python3.4 (afaik the default
`python3` in debian jessie). It would be interesting to note the
output of `pip3 --version` and `python3 --version`.

Let us know how you go. :)