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

cannot import name 'SetForegroundWindow' from 'pywinauto.win32functions' #483

Open
arisliang opened this issue Dec 27, 2022 · 1 comment

Comments

@arisliang
Copy link

env

OS: win10
PYTHON_VERSION: 3.9.12
EASYTRADER_VERSION: '0.23.0'
BROKER_TYPE: universal_client
pywinauto 0.6.8

problem

文档里的例子user = et.use('universal_client')会出现错误


ImportError Traceback (most recent call last)
Cell In[2], line 1
----> 1 user = et.use('universal_client')

File ~\miniconda3\envs\test\lib\site-packages\easytrader\api.py:67, in use(broker, debug, **kwargs)
64 return GFClientTrader()
66 if broker.lower() in ["universal_client", "通用同花顺客户端"]:
---> 67 from easytrader.universal_clienttrader import UniversalClientTrader
69 return UniversalClientTrader()
71 if broker.lower() in ["ths", "同花顺客户端"]:

File ~\miniconda3\envs\test\lib\site-packages\easytrader\universal_clienttrader.py:6
3 import pywinauto
4 import pywinauto.clipboard
----> 6 from easytrader import grid_strategies
7 from . import clienttrader
10 class UniversalClientTrader(clienttrader.BaseLoginClientTrader):

File ~\miniconda3\envs\test\lib\site-packages\easytrader\grid_strategies.py:15
13 from easytrader.log import logger
14 from easytrader.utils.captcha import captcha_recognize
---> 15 from easytrader.utils.win_gui import SetForegroundWindow, ShowWindow, win32defines
17 if TYPE_CHECKING:
18 # pylint: disable=unused-import
19 from easytrader import clienttrader

File ~\miniconda3\envs\test\lib\site-packages\easytrader\utils\win_gui.py:3
1 # coding:utf-8
2 from pywinauto import win32defines
----> 3 from pywinauto.win32functions import SetForegroundWindow, ShowWindow

ImportError: cannot import name 'SetForegroundWindow' from 'pywinauto.win32functions'

@arisliang
Copy link
Author

user = et.use('gj_client')也会出现这个错误

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

1 participant