E:\Tqpy\Sp>python tqinstaller.py –file app.py
在使用天勤量化之前,默认您已经知晓并同意以下免责条款,如果不同意请立即停止使用:https://www.shinnytech.com/blog/disclaimer/
在使用天勤量化之前,默认您已经知晓并同意以下免责条款,如果不同意请立即停止使用:https://www.shinnytech.com/blog/disclaimer/
lib not found: api-ms-win-core-path-l1-1-0.dll dependency of E:\Program Files\Python39\python39.dll
Traceback (most recent call last):
File “E:\Tqpy\Sp\tqinstaller.py”, line 15, in <module>
PyInstaller.__main__.run([
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\__main__.py”, line 126, in run
run_build(pyi_config, spec_file, **vars(args))
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\__main__.py”, line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\building\build_main.py”, line 815, in main
build(specfile, kw.get(‘distpath’), kw.get(‘workpath’), kw.get(‘clean_build’))
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\building\build_main.py”, line 762, in build
exec(code, spec_namespace)
File “E:\Tqpy\Sp\app.spec”, line 23, in <module>
exe = EXE(pyz,
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\building\api.py”, line 524, in __init__
self.__postinit__()
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\building\datastruct.py”, line 159, in __postinit__
self.assemble()
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\building\api.py”, line 620, in assemble
icon.CopyIcons(tmpnm, self.icon)
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\utils\win32\icon.py”, line 212, in CopyIcons
return CopyIcons_FromIco(dstpath, [srcpath])
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\utils\win32\icon.py”, line 149, in CopyIcons_FromIco
for i, f in enumerate(icons):
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\utils\win32\icon.py”, line 113, in __init__
entry.fromfile(file)
File “E:\Program Files\Python39\lib\site-packages\PyInstaller\utils\win32\icon.py”, line 72, in fromfile
self._fields_ = list(struct.unpack(self._format_, data))
struct.error: unpack requires a buffer of 16 bytes
不知是什么原因?
tqinstaller.py文件的内容如下:
import os
import tqsdk
import argparse
import PyInstaller.__main__
# > python tqinstaller.py –file xxxxx.py
parser = argparse.ArgumentParser()
parser.add_argument(“–file”, type=str, required=True)
args, unknown = parser.parse_known_args()
file_path = os.path.realpath(args.file)
package_name = os.path.splitext(os.path.basename(file_path))[0]
dirname = os.path.dirname(tqsdk.__file__)
PyInstaller.__main__.run([
‘–noconfirm’,
‘–name=%s’ % package_name,
‘–onefile’,
‘–add-data=%s;%s’ % (os.path.join(dirname, ‘web’), os.path.join(‘tqsdk’, ‘web’)),
‘–icon=%s’ % os.path.join(dirname, ‘web’, ‘favicon.ico’),
file_path,
])
望能解决。
下载并复制了所需的动态链接库后,现在不在提示动态链接库的问题了。但又出现一下提示:
Traceback (most recent call last):
File “E:TqpySptqinstaller.py”, line 15, in
PyInstaller.__main__.run([
File “E:Program FilesPython39libsite-packagesPyInstaller__main__.py”, line 126, in run
run_build(pyi_config, spec_file, **vars(args))
File “E:Program FilesPython39libsite-packagesPyInstaller__main__.py”, line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File “E:Program FilesPython39libsite-packagesPyInstallerbuildingbuild_main.py”, line 815, in main
build(specfile, kw.get(‘distpath’), kw.get(‘workpath’), kw.get(‘clean_build’))
File “E:Program FilesPython39libsite-packagesPyInstallerbuildingbuild_main.py”, line 762, in build
exec(code, spec_namespace)
File “E:TqpySpapp.spec”, line 23, in
exe = EXE(pyz,
File “E:Program FilesPython39libsite-packagesPyInstallerbuildingapi.py”, line 524, in __init__
self.__postinit__()
File “E:Program FilesPython39libsite-packagesPyInstallerbuildingdatastruct.py”, line 159, in __postinit__
self.assemble()
File “E:Program FilesPython39libsite-packagesPyInstallerbuildingapi.py”, line 620, in assemble
icon.CopyIcons(tmpnm, self.icon)
File “E:Program FilesPython39libsite-packagesPyInstallerutilswin32icon.py”, line 212, in CopyIcons
return CopyIcons_FromIco(dstpath, [srcpath])
File “E:Program FilesPython39libsite-packagesPyInstallerutilswin32icon.py”, line 149, in CopyIcons_FromIco
for i, f in enumerate(icons):
File “E:Program FilesPython39libsite-packagesPyInstallerutilswin32icon.py”, line 113, in __init__
entry.fromfile(file)
File “E:Program FilesPython39libsite-packagesPyInstallerutilswin32icon.py”, line 72, in fromfile
self._fields_ = list(struct.unpack(self._format_, data))
struct.error: unpack requires a buffer of 16 bytes