Skip to content
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

需要更新到 Python 3 #25

Open
Ninzero opened this issue Mar 19, 2022 · 13 comments
Open

需要更新到 Python 3 #25

Ninzero opened this issue Mar 19, 2022 · 13 comments

Comments

@Ninzero
Copy link

Ninzero commented Mar 19, 2022

你好, 在最新的 macOS 12.3 中, 系统默认的 Python 2 被移除了. 同时, 自 2020 年 1 月, Python 2 就不再收到任何安全更新. 因此希望可以有一个 Python 3 的版本.

谢谢!

@liberize
Copy link
Owner

我没有macOS电脑了,老电脑很久以前就不能升级了

@domainname
Copy link

domainname commented Mar 23, 2022

@Ninzero 我弄了个fork,增加了 Python 3 的支持。See https://github.com/domainname/alfred-dict-workflow-python3
如果 @liberize 有兴趣,我很乐意弄个 PR。

@liberize
Copy link
Owner

@domainname 如果你愿意继续维护,我在readme加上你的链接。
说实话,我已经很多年没有用macOS了,这个还能用我觉得是个奇迹...

@domainname
Copy link

domainname commented Mar 23, 2022

@liberize 哈哈,行,那我来续写这段奇迹

@Mancn-Xu
Copy link

@liberize 哈哈,行,那我来续写这段奇迹

哈哈,感谢大佬持续维护。
用了你的 python3 版本的 workflow 但是发现,一直提示 lxml 未安装。不知道是什么原因。
我是 m1 的 mac,用的 miniforge 的 python3.9。

@domainname
Copy link

@Mancn-Xu 请看下 README,需要安装lxml。

@Mancn-Xu
Copy link

Mancn-Xu commented Mar 28, 2022

您好。按照 README 中的两条命令,安装了 lxml。也没有提示报错。


mancn @ MancndeAir in ~ [19:25:46]
$ pip install lxml
Requirement already satisfied: lxml in ./miniforge3/lib/python3.9/site-packages (4.8.0)
(base)


$ sudo pip install lxml
WARNING: The directory '/Users/mancn/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Requirement already satisfied: lxml in ./miniforge3/lib/python3.9/site-packages (4.8.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
(base)

@liberize
Copy link
Owner

Screenshot_20220328-193013_Via
oxford.py这里路径是写死的,看看是不是这个原因

@Mancn-Xu
Copy link

Screenshot_20220328-193013_Via oxford.py这里路径是写死的,看看是不是这个原因


尝试修改成 /Users/mancn/miniforge3/lib/python3.9/site-packages 这个位置了。
还是提示出错。 有道词典什么的都正常。
cc test @ nj 还是会提示 lxml not installed

@domainname
Copy link

domainname commented Mar 29, 2022

@Mancn-Xu

#!/usr/bin/env python3

import sys

print(sys.path)

运行一下 python3 test.py看下是否包含 lxml 的安装目录。

查看其安装目录:pip3 show lxml

@fountainer
Copy link

@Mancn-Xu

#!/usr/bin/env python3

import sys

print(sys.path)

运行一下 python3 test.py看下是否包含 lxml 的安装目录。

查看其安装目录:pip3 show lxml

我的也是m1,同样的问题,sys.path结果为

['', '/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/opt/homebrew/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/opt/homebrew/lib/python3.10/site-packages']

pip3 show lxml结果为 /opt/homebrew/lib/python3.10/site-packages

@domainname
Copy link

@fountainer @Mancn-Xu 已经修复,见:https://github.com/domainname/alfred-dict-workflow-python3/releases/tag/v3.0.1

@AhnanWong
Copy link

@liberize 哈哈,行,那我来续写这段奇迹

哈哈,感谢大佬持续维护。 用了你的 python3 版本的 workflow 但是发现,一直提示 lxml 未安装。不知道是什么原因。 我是 m1 的 mac,用的 miniforge 的 python3.9。

python 版本问题,貌似 language 里没有 miniforge 的环境,手动指定一下。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants