Skip to content

add WO_ANKI env var #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 26, 2025
Merged

add WO_ANKI env var #40

merged 3 commits into from
Apr 26, 2025

Conversation

Madoshakalaka
Copy link
Contributor

First there was a typo in the Running without Anki session in the Readme for linux systems. It's ~/.local/ instead of ~/local (as indicated in the code and as XDG default)

Second... I was trying to run it without anki and weirdly encountered errors as it seems to have found the wrong directory:

> python run_server.py
Initializing database. This make take a while...
(init_db) Adding entries from nhk16...
(make_nhk16_table) Cannot find entries file: /home/maa/Projects/local-audio-yomichan/plugin/user_files/nhk16_files/entries.json
(init_db) Adding entries from shinmeikai8...
(AJTJapaneseSource) Cannot find entries file: /home/maa/Projects/local-audio-yomichan/plugin/user_files/shinmeikai8_files/index.json
(init_db) Adding entries from forvo...
(init_db) Adding entries from jpod...
(init_db) Adding entries from jpod_alternate...
(init_db) Filling out JMdict forms...
Finished initializing database!
Running local audio server in debug mode...

I realized the detection logic is flawed, as I somehow have anki's aqt package installed as my system package, which is carried over even when I used python -m venv ./venv to create a virtual env for this repo. So the code would always think I'm inside anki and use the wrong directory.

I think introducing a seperate env var WO_ANKI is a good solution (open to better names). It's won't affect the current plugin users. And it won't affect those who already got it working standalone either because it means they don't have aqt installed.

@icebarf
Copy link

icebarf commented Mar 15, 2025

I also faced a similar issue and I didn't think to look inside the code. Thanks for introducing a fix.

I was mostly able to fix by updating the virtual environment and reinstalling the project itself in the virtual environment see Issue#38.

Would be interesting to know how you have anki's aqt as a system package since i cannot reproduce it.

@Kuuuube Kuuuube added the bug Something isn't working label Mar 25, 2025
@Kuuuube Kuuuube merged commit 678d363 into yomidevs:master Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants