question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There's no "RemoteServer" on anki.sync file.

See original GitHub issue

This import is the problem.

https://github.com/lervag/apy/blob/0552b91f8ee9c46027c98233cc6734b0835cd37a/apy/anki.py#L9

I had to remove that import (and it’s usage on the file) because apy crashed at execution. It seems that the official Anki’s source code changed and anki.sync.py file doesn’t include “RemoteServer” anymore.


#https://github.com/ankitects/anki/blob/master/pylib/anki/sync.py
#This is all the code that's included inside anki.sync.py file



from .httpclient import HttpClient

AnkiRequestsClient = HttpClient


class Syncer:
    def sync(self) -> str:
        pass

I don’t know if this is a related issue, or even expected behavior, but after executing apy info

Anki throws the next error at restart.

erroranki

What do you think? This is related to that conflicting import?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lervagcommented, Aug 21, 2020

Ah, I see. Thanks, happy to hear you are getting somewhere. And please, feel free to open more issues. As you can understand, this is probably a WIP that will never really finish, as I need to keep adapting it to the current version of Anki.

1reaction
lervagcommented, Aug 21, 2020

That’s weird, I’m on version 2.1.23. I think that the problem is indeed with the Anki API that somehow was updated. I had to download the API from PyPi in order to make apy to read it, but the code is equal to the files on the official repository.

Huh, strange. Notice that the file sync.py on github on tag 2.1.23 is not similar to what you showed:

https://github.com/ankitects/anki/blob/2.1.23/pylib/anki/sync.py

There are some minor changes to version 2.1.24, but nothing similar to what’s in your version:

https://github.com/ankitects/anki/blob/2.1.24/pylib/anki/sync.py

The change where sync.py becomes so short is made between 2.1.27 and 2.1.28. Thus, you are clearly using a more recent version of the Anki API.

So, to make apy work, you could try to clone anki from the github repo and pin it at version 2.1.23. Then set APY_ANKI_PATH to the path to which you’ve cloned anki.

By other hand, I’ve just recently started digging into Anki’s source code and I see this project as an amazing starting point. That’s why I’m really curious, what’s the intention of importing anki.sync? As I understand that module is intended to handle sync across a network, but I could be wrong.

The point of sync.py is to implement the syncing mechanism between desktop and ankiweb. apy supports doing the syncing from the command line, which is why it relies on this part of the Anki code.

Thanks for your support 😃

My pleasure. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Anki "timezone handling..." error does not allow me to ... - Reddit
Hello, recently I have been getting the following errors anytime I open Anki: " Syncing failed: Traceback (most recent call last): File…
Read more >
Direct syncing between devices, without sync server
First, kudos: Anki has made syncing very smooth. The syncing is done via a sync server, by default AnkiWeb, which requires only a...
Read more >
Syncing Error with Ankidroid Insufficient memory #2649 - GitHub
Syncing with desktop to add new decks/new cards to ankidroid, then error message pops up saying "operation not possible due to insufficient memory...
Read more >
Syncing in Anki: Getting Started - YouTube
If you have any questions, please ask over on the user forums: https://forums.ankiweb.net0:00 Initial setup0:55 Uploading from computer1:37 ...
Read more >
Syncing in Anki: One-Way Syncs - YouTube
If you have any questions, please ask over on the user forums: https://forums.ankiweb.net0:00 Changes that require a one-way sync1:30 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found