pangao1990 / PPX

基于Python和JavaScript,一键生成macOS、Windows和Linux平台客户端应用程序
https://blog.pangao.vip/docs-ppx/
GNU Affero General Public License v3.0
231 stars 39 forks source link

webview.util.WebViewException: You must have pythonnet installed in order to use pywebview. #24

Closed 15259291016 closed 1 year ago

15259291016 commented 1 year ago

[pywebview] pythonnet cannot be loaded Traceback (most recent call last): File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\webview\guilib.py", line 52, in import_winforms import webview.platforms.winforms as guilib File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\webview\platforms\winforms.py", line 104, in from . import cef as CEF File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\webview\platforms\cef.py", line 11, in from cefpython3 import cefpython as cef ModuleNotFoundError: No module named 'cefpython3' Traceback (most recent call last): File "C:/Program Files/JetBrains/PyCharm 2022.2.2/plugins/python/helpers/pydev/pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "C:\Program Files\JetBrains\PyCharm 2022.2.2\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:\RTU配置工具\pyapp\mainCEF.py", line 98, in WebViewApp() File "D:\RTU配置工具\pyapp\mainCEF.py", line 94, in WebViewApp webview.start(gui='cef') # 启动窗口 File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\webview__init__.py", line 132, in start guilib = initialize(gui) File "C:\Users\YFB-SERVER\AppData\Local\Programs\Python\Python37\lib\site-packages\webview\guilib.py", line 102, in initialize raise WebViewException('You must have pythonnet installed in order to use pywebview.') webview.util.WebViewException: You must have pythonnet installed in order to use pywebview.

15259291016 commented 1 year ago

使用兼容模式启动会报错

15259291016 commented 1 year ago

image

15259291016 commented 1 year ago

依赖我也安装了,但是启动还是报错,必须安装pythonnet才能运行pywebview

pangao1990 commented 1 year ago

@15259291016 你好,请问在使用cef兼容模式之前,有没有进行初始化cef兼容模式操作呢? pnpm run init:cef

15259291016 commented 1 year ago

没有

15259291016 commented 1 year ago

我试一下

pangao1990 commented 1 year ago

我看你使用的环境是pyenv image

但其实,cef兼容模式使用的是 pyenvCEF 环境,在 pnpm run init:cef 初始化的时候,程序会创建pyenvCEF 环境。

15259291016 commented 1 year ago

我试一下