测试了好几个 EAF 工具,都是提示,Opening ?????, 也没有任何错误提示,请问该如何调试?

不知道有多少人真正用过 EAF, 我知道挺久了,但是知道现在才第一次试用它。

毫不意外,根本跑步起来。

呼叫 @manateelazycat

我猜我已经安装了大部分依赖的包。

  1. node, npm, wmctrl 这些命令都是在 PATH 存在的。(虽然不一定是通过包管理安装)
  2. 已经安装的 python 包也应该是比较全的。
 ╰─ $ pacman -Q |grep python-
python-appdirs 1.4.4-3
python-atspi 2.38.1-1
python-cached-property 1.5.2-3
python-cairo 1.20.0-3
python-cffi 1.14.6-1
python-chardet 4.0.0-2
python-distro 1.5.0-3
python-dnspython 1:1.16.0-3
python-evdev 1.4.0-1
python-gobject 3.40.1-1
python-idna 3.2-1
python-inotify-simple 1.3.5-1
python-markdown 3.3.4-1
python-more-itertools 8.8.0-1
python-ordered-set 4.0.2-3
python-packaging 20.9-1
python-ply 3.11-7
python-pycparser 2.20-3
python-pygit2 1.6.1-1
python-pyparsing 2.4.7-3
python-pyqt5 5.15.4-1
python-pyqt5-sip 12.9.0-1
python-pyqt5-webengine 5.15.4-1
python-pyxdg 0.27-1
python-requests 2.26.0-1
python-setuptools 1:57.4.0-1
python-six 1.16.0-1
python-urllib3 1.26.6-1
  1. 我使用的是 GNOME 3, 不确定 qt 相关的库是否安装完整,我也不知道任何办法可以调试 EAF 是否依赖某个库。

结果就是:(以 eaf-demo 为例)

minibuffer 一直显示,既没有错误提示,也没有任何反应。

image

多谢。

我之前遇到过这个情况,后来发现是我的conda的问题,关了就好了。也许能对你有一点点帮助

conda 是什么? 我没有用啊,我都是自定义的手工 require 的一些包,甚至没有用包管理,所以可以很确定没有安装过这个。

Describe the bug A clear and concise description of what the bug is.

To Reproduce Ensure you’re on the latest master branch, then note the steps to reproduce the behavior.

Expected behavior A clear and concise description of what you expected to happen.

Versions (please complete the following info):

  • Distro and DE/WM:
  • Versions of Dependencies:
  • M-x emacs-version:

Error logs Please check the *eaf* buffer, if there is any error in it, paste it here.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

1 个赞

EAF只能在xwayland支持下跑。

同时clone仓库执行install-eaf.py,尽量不要用emacs任何包管理器,只用git,install-eaf.py能跑完就可以启动,我也是gnome3

看来你的原因和我不一样,我的说白了是环境的问题,你也可以检查一下有没有环境变量设置影响到了。eaf依赖于python,而conda是管理py的一种工具,我在emacs里用了conda.el管理py,就会稳定复现你遇到的现象,我conda deactivate之后就正常了。

我现在用的标准的 GNOME3 + Wayland, 应该是 Xwayland 支持的吧?

我有尝试跑过,输出如下:


╰─ $ ./install-eaf.py  
[EAF] ------------------------------------------
[EAF] Installing core dependencies
[EAF] Running sudo apt -y install wmctrl nodejs npm libglib2.0-dev python3-pyqt5 python3-sip p
ython3-pyqt5.qtwebengine python3-pygit2 @ /home/zw963/others/Git/emacs-application-framework
error: invalid option '-y'

因为我用的是 Arch, 包管理不是 apt, 所以,我注释了一些代码。

diff --git a/install-eaf.py b/install-eaf.py
old mode 100644
new mode 100755
index 6610838..082e92f
--- a/install-eaf.py
+++ b/install-eaf.py
@@ -322,3 +322,3 @@ def install_app_deps(distro, deps_dict):
     print("\n[EAF] Installing dependencies for installed applications")
     if not args.ignore_sys_deps and sys.platform == "linux" and len(sys_deps) > 0:
         print("[EAF] Installing system dependencies")
@@ -325,1 +325,1 @@
-        install_sys_deps(distro, sys_deps)
+        # install_sys_deps(distro, sys_deps)
@@ -326,3 +326,3 @@
     if not args.ignore_py_deps and len(py_deps) > 0:
         print("[EAF] Installing python dependencies")
         install_py_deps(py_deps)
@@ -355,7 +355,7 @@ def main():
 
         if (not args.ignore_core_deps and len(args.install) == 0) or args.install_core_deps:
             print("[EAF] ------------------------------------------")
-            install_core_deps(distro, deps_dict)
+            # install_core_deps(distro, deps_dict)
             print("[EAF] ------------------------------------------")
 
         if not args.install_core_deps:

再次尝试运行,有如下输出,这意味着我还有很多包需要安装,对吗?

我指的这几个?

pysocks pypinyin retrying pytaglib pymupdf psutil

[EAF] Installing application dependencies
[EAF] (1/20) airshare. Install? (Y/n): y
[EAF] (2/20) browser. Install? (Y/n): y
[EAF] (3/20) camera. Install? (Y/n): y
[EAF] (4/20) demo. Install? (Y/n): y
[EAF] (5/20) file-browser. Install? (Y/n): y
[EAF] (6/20) file-manager. Install? (Y/n): y
[EAF] (7/20) file-sender. Install? (Y/n): y
[EAF] (8/20) image-viewer. Install? (Y/n): y
[EAF] (9/20) jupyter. Install? (Y/n): y
[EAF] (10/20) markdown-previewer. Install? (Y/n): y
[EAF] (11/20) mermaid. Install? (Y/n): y
[EAF] (12/20) mindmap. Install? (Y/n): y
[EAF] (13/20) music-player. Install? (Y/n): y
[EAF] (14/20) org-previewer. Install? (Y/n): y
[EAF] (15/20) pdf-viewer. Install? (Y/n): y
[EAF] (16/20) system-monitor. Install? (Y/n): y
[EAF] (17/20) terminal. Install? (Y/n): y
[EAF] (18/20) video-player. Install? (Y/n): y
[EAF] (19/20) vue-demo. Install? (Y/n): y
[EAF] (20/20) netease-cloud-music. Install? (Y/n): y

.....

[EAF] Running pip install --user pysocks pypinyin retrying pytaglib pymupdf psutil @ /home/zw963/others/Git/emacs-application-framework
Traceback (most recent call last):
  File "/home/zw963/others/Git/emacs-application-framework/./install-eaf.py", line 373, in <module>
    main()
  File "/home/zw963/others/Git/emacs-application-framework/./install-eaf.py", line 363, in main
    install_app_deps(distro, deps_dict)
  File "/home/zw963/others/Git/emacs-application-framework/./install-eaf.py", line 328, in install_app_deps
    install_py_deps(py_deps)
  File "/home/zw963/others/Git/emacs-application-framework/./install-eaf.py", line 113, in install_py_deps
    return run_command(command)
  File "/home/zw963/others/Git/emacs-application-framework/./install-eaf.py", line 85, in run_command
    process = subprocess.Popen(command, env = english_env, stdin = subprocess.PIPE,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pip'


install-eaf.py 文件不需要更改,是支持 pacman 的,没记错的话,懒猫用的就是 arch

至于为什么会识别出 apt ,不太清楚,可能是 get_distro() 这个函数有 bug

我也无法安装eaf,在archlinux上。

哦,看你贴的源码我知道原因了,因为我 $HOME 下面的某个 path 里面有个 apt 命令(只是一个 wrapper)

不过根据 which(‘apt’) 判断还是有点不准确啊,我觉得通过下面的判断更准确一些。

if [[ $(cat /etc/issue) =~ Ubuntu|Mint|Deepin ]]; then
 ....
elif [[ $(cat /etc/os-release) =~ openSUSE ]]; then
 ....
elif [[ $(cat /etc/issue) =~ Arch|Manjaro ]]; then
fi

还是不行,下面是错误信息。(并未提示要我安装 pip, 或通过包管理安装所需的包)

 ╰─ $ python eaf.py
Traceback (most recent call last):
  File "/home/zw963/others/Git/emacs-application-framework/eaf.py", line 31, in <module>
    from core.utils import PostGui, string_to_base64, eval_in_emacs, init_epc_client, close_epc_client, message_to_emacs, list_string_to_list, get_emacs_vars, get_emacs_config_dir, to_camel_case
  File "/home/zw963/others/Git/emacs-application-framework/core/utils.py", line 25, in <module>
    from epc.client import EPCClient
ModuleNotFoundError: No module named 'epc'

pip install epc?

嗯,但是 python eaf.py 没有给有用的错误提示,我觉得这算是个问题。

好吧我搞错了,应该先运行 python install-eaf.py , 但是还是出错。

╰─ $ python install-eaf.py 
[EAF] Running sudo pacman -Sy --noconfirm @ /home/zw963/others/Git/emacs-application-framework
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
 archlinuxcn is up to date
[EAF] ------------------------------------------
[EAF] Installing core dependencies
[EAF] Running sudo pacman -Sy --noconfirm wmctrl python-pyqt5 python-pyqt5-sip python-pyqtwebengine @ /home/zw963/others/Git/emacs-application-framework
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
 archlinuxcn is up to date
warning: wmctrl-1.07-6 is up to date -- reinstalling
warning: python-pyqt5-5.15.4-1 is up to date -- reinstalling
warning: python-pyqt5-sip-12.9.0-1 is up to date -- reinstalling
warning: python-pyqt5-webengine-5.15.4-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (4) python-pyqt5-5.15.4-1  python-pyqt5-sip-12.9.0-1  python-pyqt5-webengine-5.15.4-1  wmctrl-1.07-6

Total Installed Size:  27.46 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] 
(4/4) checking keys in keyring                                                                                     [####################################################################] 100%
(4/4) checking package integrity                                                                                   [####################################################################] 100%
(4/4) loading package files                                                                                        [####################################################################] 100%
(4/4) checking for file conflicts                                                                                  [####################################################################] 100%
(4/4) checking available disk space                                                                                [####################################################################] 100%
:: Processing package changes...
(1/4) reinstalling wmctrl                                                                                          [####################################################################] 100%
(2/4) reinstalling python-pyqt5-sip                                                                                [####################################################################] 100%
(3/4) reinstalling python-pyqt5                                                                                    [####################################################################] 100%
(4/4) reinstalling python-pyqt5-webengine                                                                          [####################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
[EAF] Running pip install --user epc lxml @ /home/zw963/others/Git/emacs-application-framework
Traceback (most recent call last):
  File "/home/zw963/others/Git/emacs-application-framework/install-eaf.py", line 373, in <module>
    main()
  File "/home/zw963/others/Git/emacs-application-framework/install-eaf.py", line 358, in main
    install_core_deps(distro, deps_dict)
  File "/home/zw963/others/Git/emacs-application-framework/install-eaf.py", line 215, in install_core_deps
    install_py_deps(deps_dict["pip"][sys.platform])
  File "/home/zw963/others/Git/emacs-application-framework/install-eaf.py", line 113, in install_py_deps
    return run_command(command)
  File "/home/zw963/others/Git/emacs-application-framework/install-eaf.py", line 85, in run_command
    process = subprocess.Popen(command, env = english_env, stdin = subprocess.PIPE,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pip'

 ╭─ 20:53  zw963 ⮀ ~/others/Git/emacs-application-framework ⮀ ⭠ (375b625) master % u=  ➦ ruby-3.0.2  0 
 ╰─ $ 1  pip --version
pip 21.2.4 from /home/zw963/.local/lib/python3.9/site-packages/pip (python 3.9)

你没装pip

安装pythone-pip就好了。

看我最后一行输出。

╭─ 20:53  zw963 ⮀ ~/others/Git/emacs-application-framework ⮀ ⭠ (375b625) master % u=  ➦ ruby-3.0.2  0 
 ╰─ $ 1  pip --version
pip 21.2.4 from /home/zw963/.local/lib/python3.9/site-packages/pip (python 3.9)

一般开发相关的工具,大家都不用包管理来安装吧? 我是按照官方给的那个 pip 安装脚本安装的, pip 可以用。

 ╰─ $ pip list
Package            Version
------------------ -------
appdirs            1.4.4
Brlapi             0.8.2
btrfsutil          5.13.1
cached-property    1.5.2
ceph               1.0.0
ceph-volume        1.0.0
cephfs             2.0.0
cephfs-shell       0.0.1
cffi               1.14.6
chardet            4.0.0
chrome-gnome-shell 0.0.0
distro             1.5.0
dnspython          1.16.0
epc                0.0.5
evdev              1.4.0
getmail6           6.18.3
idna               3.2
inotify-simple     1.3.5
isc                2.0
lensfun            0.3.95
libfdt             1.6.1
louis              3.18.0
lxml               4.6.3
Markdown           3.3.4
more-itertools     8.8.0
netsnmp-python     1.0a1
OpenCC             1.1.2
ordered-set        4.0.2
packaging          20.9
pip                21.2.4
ply                3.11
pwquality          1.4.4
pycairo            1.20.0
pycparser          2.20
pygit2             1.6.1
PyGObject          3.40.1
pyparsing          2.4.7
PyQt5              5.15.4
PyQt5-sip          12.9.0
PyQtWebEngine      5.15.4
python-xlib        0.31
pyxdg              0.27
rados              2.0.0
rbd                2.0.0
requests           2.26.0
rgw                2.0.0
setuptools         57.4.0
sexpdata           0.0.3
six                1.16.0
team               1.0
urllib3            1.26.6
wheel              0.37.0
xkeysnail          0.4.0

我看这包肥猫打的,就装了,不懂

 
❯ pactree python-pip
python-pip
├─python-appdirs
│ └─python
│   ├─bzip2
│   │ ├─glibc
│   │ │ ├─linux-api-headers provides linux-api-headers>=4.10
│   │ │ ├─tzdata
│   │ │ └─filesystem
│   │ │   └─iana-etc
│   │ └─bash provides sh
│   │   ├─readline
│   │   │ ├─glibc
│   │   │ ├─ncurses
│   │   │ │ ├─glibc
│   │   │ │ └─gcc-libs
│   │   │ │   └─glibc provides glibc>=2.27
│   │   │ └─ncurses provides libncursesw.so=6-64
│   │   ├─readline provides libreadline.so=8-64
│   │   ├─glibc
│   │   └─ncurses
│   ├─expat
│   │ └─glibc
│   ├─gdbm
│   │ ├─glibc
│   │ ├─bash provides sh
│   │ └─readline provides libreadline.so=8-64
│   ├─libffi
│   │ └─glibc
│   ├─libnsl
│   │ ├─glibc
│   │ └─libtirpc
│   │   └─krb5
│   │     ├─glibc
│   │     ├─e2fsprogs
│   │     │ ├─bash provides sh
│   │     │ └─util-linux-libs
│   │     ├─e2fsprogs provides libss.so=2-64
│   │     ├─e2fsprogs provides libcom_err.so=2-64
│   │     ├─libldap
│   │     │ ├─libsasl
│   │     │ │ └─openssl
│   │     │ │   └─glibc
│   │     │ └─e2fsprogs
│   │     └─keyutils
│   │       ├─glibc
│   │       └─bash provides sh
│   ├─libxcrypt
│   │ └─glibc
│   ├─openssl
│   └─zlib
│     └─glibc
├─python-cachecontrol
│ ├─python-msgpack
│ │ └─python
│ └─python-requests
│   ├─python-urllib3
│   │ └─python
│   ├─python-chardet
│   │ └─python
│   └─python-idna
│     └─python
├─python-colorama
│ └─python
├─python-contextlib2
│ └─python
├─python-distlib
│ └─python
├─python-distro
│ ├─python
│ └─python-setuptools
│   ├─python-appdirs
│   ├─python-more-itertools
│   │ └─python
│   ├─python-ordered-set
│   │ └─python
│   ├─python-packaging
│   │ ├─python-pyparsing
│   │ │ └─python
│   │ └─python-six
│   │   └─python
│   └─python-pyparsing
├─python-html5lib
│ ├─python-six
│ └─python-webencodings
│   └─python
├─python-packaging
├─python-pep517
│ └─python-tomli
│   └─python
├─python-progress
│ └─python
├─python-requests
├─python-retrying
│ └─python-six
├─python-resolvelib
│ └─python
├─python-setuptools
├─python-six
├─python-toml
│ └─python
└─python-pyopenssl
  ├─openssl
  ├─python
  ├─python-six
  └─python-cryptography
    └─python-cffi
      └─python-pycparser
        └─python-ply
          └─python

感觉可能是环境变量的问题, 可以改改脚本, 看下 english_env 里面的 PATH 有没有 pip 那个目录.

打印了 english_env 里面的 PATH 出来,似乎有的。~/.local/bin