Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#69423 - [anki] Launch script breaks if current shell python is not system

Attached to Project: Community Packages
Opened by Will Robson (wrbs) - Sunday, 24 January 2021, 11:50 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 24 January 2021, 13:04 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The Anki start script (/usr/bin/anki) breaks if the current shell environment doesn't use the system Python (such as using a tool like pyenv to have different versions for different projects).

$ anki
Traceback (most recent call last):
File "/usr/bin/anki", line 3, in <module>
import aqt
ModuleNotFoundError: No module named 'aqt'

This is as the script starts

#/usr/bin/env python3

not

#/usr/bin/python

I've had this issue for years - and in the past my workarounds to avoid touching system files have been to

1. Explicitly launch Anki with the system Python (/usr/bin/python /usr/bin/anki)
2. Make a local wrapper script to do this higher on the path

However the easier fix would to be to either patch the script or include a different launch script in the distribution - the only contents would be:

#!/usr/bin/python

import aqt
aqt.run()

Steps to reproduce:

1. Install anki 2.1.35-3
2. Install locally some kind of non-system python with independent site-packages (e.g. using https://github.com/pyenv/pyenv) and enable it.
3. Run anki
This task depends upon

Closed by  Doug Newgard (Scimmia)
Sunday, 24 January 2021, 13:04 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Don't break your python env for general usage

Loading...