使用pyins检测问题

2024-03-28 17:07:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试用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仍然没有找到utils。我认为我没有在元组中输入正确的路径,但是我不知道我应该做什么(程序应该已经‘在’libraries目录中,所以理论上它不应该工作吗?)你知道吗

我用anaconda安装了langdetect。问题是我没有使用我的笔记本电脑来构建.app文件,所以如果它是一个通用路径而不是特定路径,我会引用它。你知道吗

谢谢!你知道吗


Tags: 文件ofthepath代码路径appyour