我试图在oython中编译我的代码,该代码将库langdetect用于带有pyinstaller的.app。
在这个问题中回答:https://github.com/pyinstaller/pyinstaller/issues/2680
我修改了.spec文件以包含此内容:
a = Analysis(
# your other stuff here...
datas=[
('langdetect/utils', 'langdetect/utils'), # for messages.properties file
('langdetect/profiles', 'langdetect/profiles'), # don't forget if you load langdetect as a submodule of your app, change the second string to the relative path from your parent module. The first argument is the relative path inside the pyinstaller bundle.
]
# the rest of your analysis spec...
)
但是pyinstaller stil没有找到utils。我认为我没有在元组中进入正确的道路,但我不知道我应该做什么(该程序应该已经在' in' in库目录,理论上不应该起作用吗?)
我用anaconda anaconda来安装langdetect。问题是我没有使用我的笔记本电脑来构建.app文件,所以如果它是通用路径而不是特定路径,我会推荐它。
谢谢!
答案 0 :(得分:0)
我有同样的问题。问题出在langdetect库。我改用textblob库,它运行良好。