简体   繁体   English

ImportError:无法从“talon.signature”导入名称“EXTRACTOR_FILENAME”

[英]ImportError: cannot import name 'EXTRACTOR_FILENAME' from 'talon.signature'

I am having trouble getting an import statement to work.我无法让import语句正常工作。 I am attempting to use this package: https://github.com/mailgun/talon我正在尝试使用这个 package: https://github.com/mailgun/talon

I am running the following command:我正在运行以下命令:

from talon.signature import EXTRACTOR_FILENAME, EXTRACTOR_DATA

I get the following error:我收到以下错误:

ImportError: cannot import name 'EXTRACTOR_FILENAME' from 'talon.signature' (system path to file)

While troubleshooting I don't see EXTRACTOR_FILENAME or EXTRACTOR_DATA defined anywhere.在进行故障排除时,我没有在任何地方看到EXTRACTOR_FILENAMEEXTRACTOR_DATA定义。 I did a search in directory for all files.我在目录中搜索了所有文件。 Is there some sort of convention in python where EXTRACTOR_FILENAME maps to a specific class? python 中是否有某种约定,其中EXTRACTOR_FILENAME映射到特定的 class?

For your project the import looks like this:对于您的项目,导入如下所示:

  import talon
  from talon import quotations

Put those statements on the top of your file, and it should work.将这些语句放在文件的顶部,它应该可以工作。 if you don't have the packages on your system type this in your terminal:如果您的系统上没有软件包,请在终端中输入:

pip install talon

The Github repo also explains this Github repo 也解释了这一点

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM