janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
12.63k stars 1.33k forks source link

How to enable Kobo sync feature #1273

Closed shermp closed 4 years ago

shermp commented 4 years ago

Describe the bug/problem I have not been able to figure out how to enable the Kobo sync feature in the nightly/develop version of calibre-web.

To Reproduce Steps to reproduce the behavior:

  1. As admin, go to Admin page
  2. Nothing about kobo in feature configuration, or anywhere else

Expected behavior Some Kobo related configuration appear on the Admin or user panel

Environment (please complete the following information):

Additional context Looking at the debug logs, there is nothing related showing to Kobo syncing showing up.

shermp commented 4 years ago

Ok, so it definitely appears to be a Windows installation problem.

Just tried installing calibre-web in my Ubuntu VM, and after switching to nightly, the Kobo sync option appears.

I saw there was an issue installing at least one of the requirements in Windows, so that may be the issue.

shermp commented 4 years ago

Even after successfully installing requirements.txt (optional-requirements.txt is another story), the Kobo stuff still doesn't appear on Windows :(

(Note, the issue appears to be astroid 2.3.2 being incompatible with six 1.14. Explicitly installing astroid 2.3.3 seems to solve that issue)

OzzieIsaacs commented 4 years ago

Please show me the installed dependencies. (Visible in about section). Please switch your log level to debug and restart, and take a look if there is any output regarding kobo: "cannot import SyncToken, syncing books with Kobo Devices will not work..."

OzzieIsaacs commented 4 years ago

For me it's working: grafik

shermp commented 4 years ago

Hi, thanks for the reply.

Here's the installed libraries:

Linked Libraries
Program Library Installed Version
Platform    Windows 10 10.0.18362 AMD64 Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
Python  3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)]
Calibre_Web 0.6.7 Beta - 6643f0d1e0f398fcd7b6b20ecbb4758bdcf8a680 - 2020-03-14T10:45:58+01:00
WebServer   Tornado 6.0.4
Flask   1.1.1
Flask_Login 0.5.0
Flask_Principal 0.4.0
Werkzeug    1.0.0
Babel   2.8.0
Jinja2  2.11.1
Requests    2.22.0
SqlAlchemy  1.3.15
pySqlite    2.6.0
SQLite  3.28.0
iso639  0.4.5
pytz    2019.3
Unidecode   installed
Flask_SimpleLDAP    not installed
Goodreads   not installed
jsonschema  not installed
Image Magick    not installed
PyPdf   v1.26.0
lxml    v4.4.1.0
Wand    not installed
Pillow  not installed
Comic_API   not installed
ebook converter not configured

I already had logs set to debug, so here's the logs starting from when I just launched it a few minutes ago:

[2020-03-28 18:35:53,778] DEBUG {cps.comic:33} cannot import comicapi, extracting comic metadata will not work: No module named 'comicapi'
[2020-03-28 18:35:53,987] DEBUG {cps.uploader:43} cannot import Image, generating pdf covers for pdf uploads will not work: MagickWand shared library not found.
You probably had not installed ImageMagick library.
Try to install:
  http://docs.wand-py.org/en/latest/guide/install.html#install-imagemagick-on-windows
[2020-03-28 18:35:53,999] DEBUG {cps.uploader:73} cannot import Pillow, using png and webp images as cover will not work: No module named 'PIL'
[2020-03-28 18:35:54,030] DEBUG {cps.cache_buster:45} Computing cache-busting values...
[2020-03-28 18:35:57,290] DEBUG {cps.cache_buster:58} Finished computing cache-busting values
[2020-03-28 18:35:57,290]  INFO {cps:89} Starting Calibre Web...
[2020-03-28 18:35:57,369]  INFO {cps.server:152} Starting Tornado server on :8083

And The features screen in the admin panel: calibre-web-features

shermp commented 4 years ago

Note, I'm somewhat handy with Python if there is anything you want me to try out.

OzzieIsaacs commented 4 years ago

You are missing "jsonschema", please try to reinstall it via pip

shermp commented 4 years ago

Just saw that, by sticking a print statement after log.debug("cannot import SyncToken, syncing books with Kobo Devices will not work: %s", err). Interestingly, that didn't show up in the debug log, but it did print to stdout when I added the print()

shermp commented 4 years ago

Ok, now it works.

I noticed jsonchema is not in requirements.txt, should it be added?

Also, installing it threw up another ERROR: astroid 2.3.2 has requirement six==1.12, but you'll have six 1.14.0 which is incompatible.

OzzieIsaacs commented 4 years ago

If you don't have a kobo reader you don't need jsonschema. So it's just optional and therefore listed in optional-requirements.txt (Don't install everythong from optional-requirements.txt, open the file and take a look what the different features are and install only the needed ones). I'm a bit behind with documentation especially with the kobo syncing. astroid is not a direct import of calibre-web, I upgraded six to 1.14 on linux, I don't see the output. When do you get it? (if in logfile I need the log line before and after to approximately know where it's thrown, so I can search for it)

shermp commented 4 years ago

The error about astroid is thrown during the pip installation. As you said, it's an indirect import by some other library or libraries. It seems somewhere, some package must be trying to install astroid 2.3.2, which has a hard dependency on six 1.12. astroid 2.3.3 relaxes this restriction, but for whatever reason pip isn't trying to install it.

Here's the output of pip installing jsonschema if you're interested:

 pip3 install --target vendor jsonschema
Collecting jsonschema
  Using cached https://files.pythonhosted.org/packages/c5/8f/51e89ce52a085483359217bc72cdbf6e75ee595d5b1d4b5ade40c7e018b8/jsonschema-3.2.0-py2.py3-none-any.whl
Collecting setuptools (from jsonschema)
  Using cached https://files.pythonhosted.org/packages/a0/df/635cdb901ee4a8a42ec68e480c49f85f4c59e8816effbf57d9e6ee8b3588/setuptools-46.1.3-py3-none-any.whl
Collecting attrs>=17.4.0 (from jsonschema)
  Using cached https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting pyrsistent>=0.14.0 (from jsonschema)
Collecting six>=1.11.0 (from jsonschema)
  Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting importlib-metadata; python_version < "3.8" (from jsonschema)
  Using cached https://files.pythonhosted.org/packages/ad/e4/891bfcaf868ccabc619942f27940c77a8a4b45fd8367098955bb7e152fb1/importlib_metadata-1.6.0-py2.py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata; python_version < "3.8"->jsonschema)
  Using cached https://files.pythonhosted.org/packages/b2/34/bfcb43cc0ba81f527bc4f40ef41ba2ff4080e047acb0586b56b3d017ace4/zipp-3.1.0-py3-none-any.whl
ERROR: astroid 2.3.2 has requirement six==1.12, but you'll have six 1.14.0 which is incompatible.
Installing collected packages: setuptools, attrs, six, pyrsistent, zipp, importlib-metadata, jsonschema
Successfully installed attrs-19.3.0 importlib-metadata-1.6.0 jsonschema-3.2.0 pyrsistent-0.16.0 setuptools-46.1.3 six-1.14.0 zipp-3.1.0
WARNING: Target directory C:\StandaloneProg\calibre-web\vendor\six-1.14.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\StandaloneProg\calibre-web\vendor\six.py already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\StandaloneProg\calibre-web\vendor\__pycache__ already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\StandaloneProg\calibre-web\vendor\bin already exists. Specify --upgrade to force replacement.
shermp commented 4 years ago

And if I had actually read the optional-requirements.txt, I probably wouldn't have opened this issue... :)

OzzieIsaacs commented 4 years ago

Mine isn't doing this:

Collecting jsonschema
  Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in c:\python36\lib\site-packages (from jsonschema) (1.5.0)
Collecting attrs>=17.4.0
  Using cached attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Requirement already satisfied: six>=1.11.0 in c:\python36\lib\site-packages (from jsonschema) (1.14.0)
Requirement already satisfied: setuptools in c:\python36\lib\site-packages (from jsonschema) (45.1.0)
Collecting pyrsistent>=0.14.0
  Using cached pyrsistent-0.16.0.tar.gz (108 kB)
Requirement already satisfied: zipp>=0.5 in c:\python36\lib\site-packages (from importlib-metadata; python_version < "3.8"->jsonschema) (3.0.0)
Installing collected packages: attrs, pyrsistent, jsonschema
    Running setup.py install for pyrsistent ... done
Successfully installed attrs-19.3.0 jsonschema-3.2.0 pyrsistent-0.16.0

But anyhow it's solved, I close the issue

shermp commented 4 years ago

Thank you very much for the assistance.

DieterKoblenz commented 4 years ago

I know this is closed, but is it possible to get this to work in a docker container (linuxserver's one?)?

jsonschema is not installed, and I am not sure how to run it.

I got it installed, though a bit dirty. I guess I should ask over at the ls github to update the package to install jsonschema?

OzzieIsaacs commented 4 years ago

You are right this is the way to do it, linuxserver should include jsonschema in their container

rubenvisscher commented 4 years ago

I know this is closed, but is it possible to get this to work in a docker container (linuxserver's one?)?

jsonschema is not installed, and I am not sure how to run it.

I got it installed, though a bit dirty. I guess I should ask over at the ls github to update the package to install jsonschema?

Linuxserver checks out the latest version of calibre-web. In version 0.6.6 jsonschema isn't added to the optional-requirements.txt (https://github.com/janeczku/calibre-web/blob/0.6.6/optional-requirements.txt). So it will work in a newer version.

OzzieIsaacs commented 4 years ago

Sorry, you are right, Kobo Sync feature was included after latest release, it‘s Only available in master and development branch

2knarf commented 3 years ago

How did you connect kobo to this?