lervag / apy

CLI script for interacting with local Anki collection
MIT License
228 stars 17 forks source link

Cannot install apy through pipx in Termux as it cannot detect Anki #66

Closed jrmallorca closed 1 year ago

jrmallorca commented 1 year ago

I've recently tried installing apy through termux via pipx. Unfortunately as it cannot detect any version of anki, it cannot be installed.

I had planned on using apy with AnkiDroid to be able to create flashcards from my phone as well. I already knew the base path of the Anki collections in AnkiDroid. Would this be possible?

Thanks for creating apy btw, it's been great at cutting out unnecessary middleware in my PC.

These are my logs

~/dotfiles $ pipx install git+https://github.com/lervag/apy
Fatal error from pip prevented installation. Full pip output in file:
    /data/data/com.termux/files/home/.local/pipx/logs/cmd_2023-06-21_15.37.13_pip_errors.log

pip seemed to fail to build package:
    git+https://github.com/lervag/apy

Some possibly relevant errors from pip install:
    ERROR: Could not find a version that satisfies the requirement anki<3.0.0,>=2.1.63 (from apy) (from versions: 2.1.24+359b9f5c, 2.1.25, 2.1.26, 2.1.28, 2.1.29, 2.1.30, 2.1.31, 2.1.32, 2.1.33, 2.1.34, 2.1.35)
    ERROR: No matching distribution found for anki<3.0.0,>=2.1.63

Error installing apy from spec
'git+https://github.com/lervag/apy'.
lervag commented 1 year ago

Glad to hear you find apy useful!

Perhaps pipx or pip on Termux somehow uses different sources? The anki package should be available on PyPI: https://pypi.org/project/anki/. I'm not very familiar with Termux, so I would not really know where to start debugging this.

lervag commented 1 year ago

Some questions that may be relevant:

Also, perhaps info on this wiki page is relevant?

jrmallorca commented 1 year ago

Not too familiar with Termux as well. I only installed it for the purposes of using apy to import flashcards through my phone as well.

Python version: 3.11.4 pip version: 23.1.2

Thank you for that web page and the anki package. Unfortunately, installing that didn't make apy available for installation as well and I don't want to install essentially the desktop version of Anki on my phone.

Feel free to close this issue as I will probably not pursue it anymore.

lervag commented 1 year ago

Ok; on my phone I've used the Ankidroid app to add cards and find it works OK. 🤷🏻

I don't really know how to help further here, though, so I'll close the issue. Let me know if you should pursue and learn something useful in the future.

jrmallorca commented 1 year ago

Ah I was planning on using a script I wrote with apy to automatically detect what should be made into cards (e.g., question :: answer) in my zettelkasten notes. Would make it so I don't have to keep going to Ankidroid and adding it manually.

lervag commented 1 year ago

Could you not do the same on your computer? If you sync your notes, I mean?

jrmallorca commented 1 year ago

That's currently what I'm doing. If I manage to write a note on my phone while my computer is out of reach, I'd have to wait until I get back to create flashcards from my notes into Anki (if I didn't want to create them manually through AnkiDroid).

I was looking to eliminate that gap in time with this idea, such that I can do the following:

  1. Create my note.
  2. Create question and answer pairs in my notes.
  3. Use script with apy to automatically detect those pairs and import them into Anki.

That way I can still remember the source/idea behind the flashcards. Note for ideating, flashcard for memorisation.

lervag commented 1 year ago

I see nothing wrong with the idea and I hope you will be able to figure it out!