我正在尝试,试图快速包装好 orca 包裹:
name: orca
version: 1
summary: orca
description: screen reader
confinement: strict
apps:
orca:
command: usr/bin/orca
parts:
orca:
plugin: nil
stage-packages:
- gnome-orca
它“捕捉”并安装得很好,但是当我运行orca
python 时,它会抱怨它无法导入 pyatspi。
/snap/orca/100001/usr/lib/python3/dist-packages/pyatspi/ 存在,所以我想知道是否存在某种权限问题。
后来:只需在 snap 中运行 python 解释器并导入 pyatspi 模块就会出现错误:
>>> import pyatspi
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 890, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/snap/orca/100001/usr/lib/python3/dist-packages/pyatspi/__init__.py", line 17, in <module>
from gi.repository import Atspi
File "/snap/orca/100001/usr/lib/python3/dist-packages/gi/importer.py", line 127, in find_module
'introspection typelib not found' % namespace)
ImportError: cannot import name Atspi, introspection typelib not found
Atspi 类型库确实存在,尽管与大多数其他类型库的位置不同:
...
/snap/orca/100001/usr/lib/girepository-1.0/Atspi-2.0.typelib
/snap/orca/100001/usr/lib/x86_64-linux-gnu/girepository-1.0/DBus-1.0.typelib
...
答案1
列出您想要在 snap 中捆绑其内容的软件包stage-packages
。例如https://github.com/ubuntu/snappy-playpen/blob/master/2048/snapcraft.yaml例如:
stage-packages:
- qml-module-qtquick2
- qmlscene