Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 模块对象不可调用_Python_Object_Module - Fatal编程技术网

Python 模块对象不可调用

Python 模块对象不可调用,python,object,module,Python,Object,Module,出于某种原因,我得到了一个模块对象是不可调用的错误。我真的不明白为什么?发生了什么事?我该怎么解决( 追溯: Traceback (most recent call last): File "time.py", line 1, in <module> import time File "/Users/Me/randomcode/time.py", line 2, in <module> start_time = time.time() TypeEr

出于某种原因,我得到了一个模块对象是不可调用的错误。我真的不明白为什么?发生了什么事?我该怎么解决(

追溯:

Traceback (most recent call last): 
    File "time.py", line 1, in <module> 
import time File "/Users/Me/randomcode/time.py", line 2, in <module> 
    start_time = time.time() 
TypeError: 'module' object is not callable
回溯(最近一次呼叫最后一次):
文件“time.py”,第1行,在
导入时间文件“/Users/Me/randomcode/time.py”,第2行,在
开始时间=time.time()
TypeError:“模块”对象不可调用

不要调用自己的脚本文件
time.py
…它正在导入自身!

代码是正确的。请提供Expection的堆栈跟踪。回溯(最近一次调用):文件“time.py”,第1行,在导入时间文件“/Users/Thambapillai/randomcode/time.py”,第2行,在start\u time=time.time()TypeError:“模块”对象不可用callable@Ravin:将stacktrace编辑到您的问题中。实际上,请将其删除-我刚刚删除了另一个文件,它成功了!谢谢!!:D@Ravin这个✓ 图标是你的朋友!
Traceback (most recent call last): 
    File "time.py", line 1, in <module> 
import time File "/Users/Me/randomcode/time.py", line 2, in <module> 
    start_time = time.time() 
TypeError: 'module' object is not callable