DoooReyn / WxReader

基于PySide6的微信读书自动阅读器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

项目如何运行?

376924098 opened this issue · comments

commented

需要Python版本是多少,运行哪个文件?

3.7的Python
(book2) ✘ ⚙ bin@bindeMacBook-Pro  ~/VsCodeProjects/WxReader/app   main ●  python Application.py
Traceback (most recent call last):
File "Application.py", line 25, in
from ui.view.WindowView import WindowView
File "/Users/bin/VsCodeProjects/WxReader/app/ui/view/WindowView.py", line 32, in
from ui.view.CefView import CefView
File "/Users/bin/VsCodeProjects/WxReader/app/ui/view/CefView.py", line 4, in
from cefpython3 import cefpython_py38 as cef
ImportError: cannot import name 'cefpython_py38' from 'cefpython3' (/Users/bin/anaconda3/envs/book2/lib/python3.7/site-packages/cefpython3/init.py)

3.8的Python
Python version not supported: 3.8.16

都有问题

commented

我 Python 的本地版本是 3.8.2。

这边建议你创建一个项目的虚拟环境 venv
激活虚拟环境之后在其中运行 pip install -r requirements.txt 安装依赖
之后运行 python app/Application.py 就可以启动项目了

commented

我 Python 的本地版本是 3.8.2。

这边建议你创建一个项目的虚拟环境 venv 激活虚拟环境之后在其中运行 pip install -r requirements.txt 安装依赖 之后运行 python app/Application.py 就可以启动项目了

新环境,Python 只有小版本有差异,不会有问题吧。。。
Traceback (most recent call last):
File "Application.py", line 15, in
from cefpython3 import cefpython_py37 as cef
File "/Users/bin/anaconda3/envs/book2/lib/python3.8/site-packages/cefpython3/init.py", line 64, in
raise Exception("Python version not supported: " + sys.version)
Exception: Python version not supported: 3.8.16 | packaged by conda-forge | (default, Feb 1 2023, 16:05:36)

commented

我 Python 的本地版本是 3.8.2。
这边建议你创建一个项目的虚拟环境 venv 激活虚拟环境之后在其中运行 pip install -r requirements.txt 安装依赖 之后运行 python app/Application.py 就可以启动项目了

新环境,Python 只有小版本有差异,不会有问题吧。。。 Traceback (most recent call last): File "Application.py", line 15, in from cefpython3 import cefpython_py37 as cef File "/Users/bin/anaconda3/envs/book2/lib/python3.8/site-packages/cefpython3/init.py", line 64, in raise Exception("Python version not supported: " + sys.version) Exception: Python version not supported: 3.8.16 | packaged by conda-forge | (default, Feb 1 2023, 16:05:36)

看了一下,这里是我犯了一个错误,不应该限定 cef 的版本。
这里导入包改为 from cefpython3 import cefpython as cef 应该就可以了。
可以 pull 一下。

commented

from cefpython3 import cefpython as cef

还是相同的错误
Traceback (most recent call last):
File "Application.py", line 15, in
from cefpython3 import cefpython as cef
File "/Users/bin/anaconda3/envs/book2/lib/python3.8/site-packages/cefpython3/init.py", line 64, in
raise Exception("Python version not supported: " + sys.version)
Exception: Python version not supported: 3.8.16 | packaged by conda-forge | (default, Feb 1 2023, 16:05:36)

commented

不应该哦。

你可以在 cefpython3/__init__.py 打个断点看下信息:

image

3.8 按理说会进入 elif sys.version_info[:2] == (3, 8): 这边的。

commented

项目使用的 cefpython3 v66.1 官方是支持到 3.9 的,可以检查下 cefpython3 是否装对了版本。

commented

项目使用的 cefpython3 v66.1 官方是支持到 3.9 的,可以检查下 cefpython3 是否装对了版本。
那我知道了,我是macos 系统,我在pip install 的时候 提示 没有v66.1版本,只找到了 66.0,我就自己改了个小版本
Requirement already satisfied: PySide6~=6.4.0 in /Users/bin/anaconda3/envs/book2/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (6.4.3)
ERROR: Could not find a version that satisfies the requirement cefpython3~=66.1 (from versions: 56.1, 56.2, 57.0, 66.0)
ERROR: No matching distribution found for cefpython3~=66.1

好像官方也没有提供 66.1 macos版
https://github.com/cztomczak/cefpython/releases

commented

还真是,没想到这是个坑。

cef 66.1 支持 python 3.8,66.0 只能支持到 3.7。

Shit,shit,shit!

我做个降级处理,改用 66.0 (这个是三个平台都支持的),并且限定 Python 版本小于 3.8。

commented

由于 cefpython3 66.1 无法提供全平台的支持,因此对它进行降级;同时,降级之后,它限定 Python 版本不能高于 3.8,望开发者知悉

  • cefpython3 降级为 66.0
  • Python < 3.8

修复 d594493