zhiyiYo / PyQt-Fluent-Widgets

A fluent design widgets library based on C++ Qt/PyQt/PySide. Make Qt Great Again.
https://qfluentwidgets.com
GNU General Public License v3.0
5.68k stars 550 forks source link

跑readme中的案例报错 #113

Closed CharlesKeeling65 closed 1 year ago

CharlesKeeling65 commented 1 year ago

Describe the bug A clear and concise description of what the bug is. 跑readme中的案例报错 examples\gallery> python demo.py


demo.py 9 from app.view.main_window import MainWindow

main_window.py 14 from .basic_input_interface import BasicInputInterface

basic_input_interface.py 4 from qfluentwidgets import (PushButton, ToolButton, PrimaryPushButton, HyperlinkButton,

ImportError: cannot import name 'EditableComboBox' from 'qfluentwidgets'

Environment

tmpD63C

zhiyiYo commented 1 year ago

版本太低了,建议到 pypi 官网下载最新版

CharlesKeeling65 commented 1 year ago

版本太低了,建议到 pypi 官网下载最新版

我更新之后,这个demo.py还是报错,其他的demo.py都能运行,就是gallery的这个还是不行 demo.py 9 from app.view.main_window import MainWindow

main_window.py 18 from .material_interface import MaterialInterface

material_interface.py 3 from qfluentwidgets.components.widgets.acrylic_label import AcrylicLabel

acrylic_label.py 9 from ...common.image_utils import gaussianBlur

image_utils.py 8 from scipy.ndimage.filters import gaussian_filter

init.py 130 from . import _distributor_init

_distributor_init.py 59 WinDLL(os.path.abspath(filename))

init.py 381 init self._handle = _dlopen(self._name, mode)

FileNotFoundError: Could not find module 'E:\Anaconda3\envs\spiderenvs\lib\site-packages\scipy.libs\libbanded5x.3OIBJ6VWWPY6GDLEMSTXSIPCHHWASXGT.gfortran-win_amd64.dll' (or one of its dependencies). Try using the full path with constructor syntax. tmpCB60

zhiyiYo commented 1 year ago

建一个新的虚拟环境试试?

CharlesKeeling65 commented 1 year ago

建一个新的虚拟环境试试?

创了新环境,也还是不行,报错QWidget: Must construct a QApplication before a QWidget,而且menu/demo.py,也没法跑了,报错如下:

Traceback (most recent call last):
  File "F:\005_Programming\PyQt6项目\PyQt-Fluent-Widgets-PyQt6\examples\menu\demo.py", line 25, in contextMenuEvent
    menu = RoundMenu(parent=self)
  File "E:\Anaconda3\envs\pyqt_envs\lib\site-packages\qfluentwidgets\components\widgets\menu.py", line 179, in __init__
    super().__init__(parent=parent)
TypeError: QWidget(parent: typing.Optional[QWidget] = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags()): argument 'parent' has unexpected type 'Demo'

类似的combo_box/demo.py,也是QWidget: Must construct a QApplication before a QWidget

zhiyiYo commented 1 year ago

用的 pyqt6 版本是多少?我平时测试都是用的 6.4.2

zhiyiYo commented 1 year ago

要不换成 pyqt6.4.2试试

CharlesKeeling65 commented 1 year ago

用的 pyqt6 版本是多少?我平时测试都是用的 6.4.2

我的是6.5.0

zhiyiYo commented 1 year ago

@CharlesKeeling65 试试 6.4.2

CharlesKeeling65 commented 1 year ago
Name: PyQt6
Version: 6.4.2
Summary: Python bindings for the Qt cross platform application toolkit
Home-page: https://www.riverbankcomputing.com/software/pyqt/
Author: Riverbank Computing Limited
Author-email: info@riverbankcomputing.com
License: GPL v3
Location: e:\anaconda3\envs\pyqt_envs\lib\site-packages
Requires: PyQt6-Qt6, PyQt6-sip
Required-by:

换成6.4.2 还是和上面的错误一样

(pyqt_envs) PS F:\005_Programming\PyQt6项目\PyQt-Fluent-Widgets-PyQt6\examples\gallery> python demo.py
QWidget: Must construct a QApplication before a QWidget

而且我的PyQt-Fluent-Widgets版本信息是

Name: PyQt-Fluent-Widgets
Version: 0.6.9
Summary: A fluent design widgets library based on PyQt5
Home-page: https://github.com/zhiyiYo/PyQt-Fluent-Widgets
Author: zhiyiYo
Author-email: shokokawaii@outlook.com
License: GPLv3
Location: e:\anaconda3\envs\pyqt_envs\lib\site-packages
Requires: darkdetect, PyQt5, PyQt5-Frameless-Window
Required-by:

好像和最新的那个issue里那个人的版本不一样,他是0.6.10,我好像更新不了

问题解决了,我当时下载成PyQt-Fluent-Widgets,重新下了PyQt6-Fluent-Widgets就可以了,感谢作者!