FutunnOpen / py-futu-api

富途 OpenAPI Python SDK
Apache License 2.0
1.03k stars 219 forks source link

Can futuapi code work with pyinstaller #92

Closed elise10583 closed 3 years ago

elise10583 commented 3 years ago

Hi I have created a few python script to run the futuapi with some trading algorithm. However, when I try to create the exe using pyinstaller, I am getting this error when running the exe. 'OpenQuoteContext' is not defined Please advise. Thanks, Elise

loadatom commented 3 years ago

It can work with pyinstaller, but needs some tweaks. First please follow the instructions here: https://openapi.futunn.com/futu-api-doc/en/qa/other.html#5019. If you still get problems, please provide more information, such as a basic script that can reproduce the problem.

elise10583 commented 3 years ago

Not too sure if I should open up a new issue. I try following the instructions in https://openapi.futunn.com/futu-api-doc/en/qa/other.html#5019 But I am still getting the problem with the following error

C:\Users\ChiWa\PycharmProjects\TradingProject\dist\5Warrant>5Warrant.exe Traceback (most recent call last): File "5Warrant.py", line 22, in NameError: name 'OpenQuoteContext' is not defined [16824] Failed to execute script '5Warrant' due to unhandled exception!