[英]Importing a module but the interpreter is not recognizing the function in that module python
我正在将标记化模块导入到我的项目中。 标记导入regexp.py
当我尝试在程序中调用位于regexp.py中的函数时
m = tokenize.regexp_tokenize(itemToString.lower(), n)
我收到一个错误的“模块”对象,没有属性“ regexp_tokenize”。
regexp_tokenize是regexp.py中的一个函数。
知道可能是什么问题吗? 提前致谢
您说自己是导入的tokenize,而不是regexp。 如果regexp_tokenize
位于regexp中,则需要自己导入regexp。
您可以通过tokenzie.regexp.regexp_tokenize
访问它,但这不是通常的做法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.