简体   繁体   English

尝试将Python 2.7脚本移植到Python 3.6(队列模块…)时,出现“模块不可调用”错误?

[英]I am getting “module is not callable” error while trying to port Python 2.7 script to Python 3.6 (the queue module…)?

This is what I have in Python 2.7: 这是我在Python 2.7中的功能:

from Queue import Queue
self.queue = Queue()

What I'm trying so far to port to 3.6 looks like this: 到目前为止,我正在尝试移植到3.6的内容如下:

import queue as queue
self.queue = queue()

But I'm getting "module is not callable"? 但是我收到“模块不可调用”的信息吗? I am bit of noob in Python :), it's likely a simple error, thanks! 我在Python中有点菜鸟:),这可能是一个简单的错误,谢谢!

In Python3 use 在Python3中使用

from queue import Queue
self.queue = Queue()

暂无
暂无

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

相关问题 在python 2.7中导入zipfile模块时出现语法错误 - I am getting a syntax error while importing the zipfile module in python 2.7 为什么我收到TypeError:“模块”对象在python中不可调用? - Why am I getting TypeError: 'module' object is not callable in python? 为什么我在 python 3 中无法调用“模块”对象? - Why am I getting 'module' object is not callable in python 3? 导入python脚本作为模块时出现错误 - Getting error while importing a python script as module 尝试在 Python 2.7 中导入任何模块时,如何解决“NameError: name 'null' is not defined”错误 - How can I resolve a "NameError: name 'null' is not defined" error while trying to import any module in Python 2.7 PyDBG Python 2.7错误:“TypeError:'module'对象不可调用” - PyDBG Python 2.7 error: “TypeError: 'module' object is not callable” 为什么在Python 2.7中尝试打印字符串时出现错误? - Why am I getting an error trying to print a string in Python 2.7? 使python代码与2.7和3.6+版本兼容-关于Queue模块 - Making python code compatible for working with 2.7 and 3.6+ versions- regarding Queue module 尝试用Python制作一个小程序时,我得到一个:AttributeError:模块'backend'没有属性'insert' - While trying to make a small program in Python, I am getting an: AttributeError: module 'backend' has no attribute 'insert' 我正在尝试导入numpy以在Python脚本中使用,但出现错误“没有名为numpy的模块” - I am trying to import numpy for use in a Python script but I get the error “No module named numpy”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM