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

ImportError: DLL load failed: 找不到指定的程序。 #141

Closed
keymou opened this issue Apr 22, 2023 · 2 comments
Closed

ImportError: DLL load failed: 找不到指定的程序。 #141

keymou opened this issue Apr 22, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@keymou
Copy link

keymou commented Apr 22, 2023

Describe the bug
ImportError: DLL load failed: 找不到指定的程序。

Environment

  • OS: Windows7
  • DPI scaling: default
  • Python: 3.6.5 bit 64
  • PySide6: 6.0.1
  • PyQt-Fluent-Widgets: 0.7.2

To Reproduce
PyCharm create a virtualenvs to pip install PyQt-Fluent-Widgets :

  1. Go to run PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\examples\button\demo.py
  2. See error

Code

# coding:utf-8
import sys

from PySide6.QtCore import Qt, QSize
from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout
from qfluentwidgets import ToolButton
from qfluentwidgets import FluentIcon as FIF


class Demo(QWidget):

    def __init__(self):
        super().__init__()

        self.toolButton = ToolButton(FIF.SETTING, self)
        self.vBoxLayout = QVBoxLayout(self)
        self.vBoxLayout.addWidget(self.toolButton, 0, Qt.AlignCenter)
        self.vBoxLayout.setSizeConstraint(QVBoxLayout.SetMinAndMaxSize)
        self.resize(400, 400)
        self.setStyleSheet('Demo{background:white}')


if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = Demo()
    w.show()
    app.exec_()

Expected behavior

Traceback (most recent call last):
  File "D:\NetDevOps\python\PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\examples\button\demo.py", line 6, in <module>
    from qfluentwidgets import ToolButton
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "D:\NetDevOps\python\PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\qfluentwidgets\__init__.py", line 17, in <module>
    from .components import *
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "D:\NetDevOps\python\PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\qfluentwidgets\components\__init__.py", line 1, in <module>
    from .dialog_box import *
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "D:\NetDevOps\python\PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\qfluentwidgets\components\dialog_box\__init__.py", line 1, in <module>
    from .color_dialog import ColorDialog
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "D:\NetDevOps\python\PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\qfluentwidgets\components\dialog_box\color_dialog.py", line 8, in <module>
    from ..widgets import Slider, ScrollArea, PushButton, PrimaryPushButton
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "D:\NetDevOps\python\PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\qfluentwidgets\components\widgets\__init__.py", line 3, in <module>
    from .combo_box import ComboBox, EditableComboBox
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "D:\NetDevOps\python\PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\qfluentwidgets\components\widgets\combo_box.py", line 8, in <module>
    from .menu import RoundMenu
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "D:\NetDevOps\python\PyQt-Fluent-Widgets-PySide6\PyQt-Fluent-Widgets-PySide6\qfluentwidgets\components\widgets\menu.py", line 2, in <module>
    from qframelesswindow import WindowEffect
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Python36\lib\site-packages\qframelesswindow\__init__.py", line 22, in <module>
    from .titlebar import TitleBar, TitleBarButton, SvgTitleBarButton, StandardTitleBar
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Python36\lib\site-packages\qframelesswindow\titlebar\__init__.py", line 12, in <module>
    from ..utils import startSystemMove
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Python36\lib\site-packages\qframelesswindow\utils\__init__.py", line 5, in <module>
    from .win32_utils import WindowsMoveResize as MoveResize
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Python36\lib\site-packages\qframelesswindow\utils\win32_utils.py", line 7, in <module>
    import win32api
  File "C:\Python36\lib\site-packages\shiboken6\files.dir\shibokensupport\__feature__.py", line 140, in _import
    return original_import(name, *args, **kwargs)
ImportError: DLL load failed: 找不到指定的程序
@keymou keymou added the bug Something isn't working label Apr 22, 2023
@zhiyiYo
Copy link
Owner

zhiyiYo commented Apr 22, 2023

试下我博客里面的方法:https://www.cnblogs.com/zhiyiYo/p/16340429.html

@keymou
Copy link
Author

keymou commented Apr 22, 2023

试下我博客里面的方法:https://www.cnblogs.com/zhiyiYo/p/16340429.html

将虚拟环境中site-packages/pywin32_system32目录下两个dll复制到system32下,不提示Import Error,
提示 ModuleNotFoundError: No module named 'dataclasses',
qfluentwidgets\components\widgets\stacked_widget.py 引用dataclasses
dataclasses是python3.7新增的,python版本3.6不支持。

@keymou keymou closed this as completed Apr 22, 2023
@zhiyiYo zhiyiYo pinned this issue Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants