pyinstaller打包plotly后无法正常运行的问题

pyinstaller打包plotly后无法正常运行的问题

在使用pyinstaller打包带有plotly的程序后,在运行程序时会出现如下反馈

"c:\users*\appdata\local\continuum\anaconda3\envs\py34\lib\site-p ackages\PyInstaller\loader\pyimod03_importers.py", line 474, in get_data 
with open(path, 'rb') as fp: 
FileNotFoundError: [Errno 2] No such file or directory:
 'H:\Python\Commodity_M AI_Trade_List\Code\dist\comdty_runtime\plotly\package_data\default-schema. json' 
 Failed to execute script comdty_runtime

这是由于pyinstaller现在还无法兼容plotly的原因所造成的,解决方法如下:
1.在打包时不要选择使用-F打包成单个文件
2.在打包完后,从anaconda目录下复制plotly文件夹(作者的位置是E:Anaconda3\Lib\site-packages\plotly)到打包完成的文件夹中(作者的位置是D:\Anaconda Library\XXXX项目\dist{exe名字文件夹}\)。

复制完成后,就可以顺利使用exe文件啦~

你可能感兴趣的:(pyinstaller打包plotly后无法正常运行的问题)