AttributeError:模块“ numbers”没有属性“ Integral”
我在Mac上工作。已安装Python 3.7.0。安装了Anaconda,Pandas和Numpy。
在命令行中,如果我输入Python并在Python shell内,我可以输入import Pandas,它看起来像是可行的。
但是在Komodo Editor中,如果执行:
#!/usr/bin/env python3
import pandas
我收到以下错误:
AttributeError: module 'numbers' has no attribute 'Integral'
编辑:
这是完整的代码:
#!/usr/bin/env python3
import pandas
def main():
print('Hello, World.')
if __name__ == '__main__': main()
这是回溯:
Traceback (most recent call last):
File "/Users/Barry/Documents/Python/testpanda.py", line 3, in <module>
import pandas
File "/usr/local/lib/python3.7/site-packages/pandas/__init__.py", line 13, in <module>
__import__(dependency)
File "/usr/local/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/usr/local/lib/python3.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python3.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python3.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python3.7/site-packages/numpy/core/__init__.py", line 35, in <module>
from . import _internal # for freeze programs
File "/usr/local/lib/python3.7/site-packages/numpy/core/_internal.py", line 18, in <module>
from .numerictypes import object_
File "/usr/local/lib/python3.7/site-packages/numpy/core/numerictypes.py", line 948, in <module>
_register_types()
File "/usr/local/lib/python3.7/site-packages/numpy/core/numerictypes.py", line 943, in _register_types
numbers.Integral.register(integer)
AttributeError: module 'numbers' has no attribute 'Integral'
-
查看
github link
共享者Dušan Maďar
, 很可能您有一个名为’numbers.py
‘的文件,可能会干扰pythonLib
。重命名该文件应解决此问题。