用Auto-py-to-exe 打包
---------------------------------------------
pathTest.py
import shioaji as sj
api = sj.Shioaji()
----------------------------------------------
因為打包後的執行檔沒有module name 會error 所以補上:
1.shioaji.backend.http.client 2.requests 3.shioaji.backend.http.order 4.shioaji.backend.http.futureoption 5.shioaji.backend.http.futureoption.order
6.shioaji.backend.http.utils 7.shioaji.backend.http.futureoption.constant 8.shioaji.backend.http.constant 9. shioaji.backend.http.stock
10.shioaji.backend.http.stock.order 11.shioaji.backend.http.stock.constant 12.shioaji.backend.http.account
13.shioaji.backend.http.futureoption.account 14.shioaji.backend.http.stock.account 15.shioaji.backend.http.contract 16.filelock 17.unittest.mock 18.shioaji.common
-----------------------------------------------
因為打包後讀不到dll 檔案,所以複製dll 到執行檔路徑。並修改修改__init__檔 當讀不到dll 時候讀local的
-----------------------------------------------
現在執行出現這個問題不知道怎麼解掉
KeyError: 'stag'
Traceback (most recent call last):
File "pathTest.py", line 11, in <module>
File "shioaji\shioaji.py", line 126, in __init__
File "shioaji\backend\solace\utils.pyx", line 84, in shioaji.backend.solace.utils.read_config
File "configparser.py", line 963, in __getitem__
KeyError: 'stag'