Python“ ModuleNotFoundError:没有名为'numbers'的模块”

时间:2020-10-10 17:22:09

标签: python numpy

我试图为我正在处理的项目安装numpy并使用numpy并收到错误

module 'numbers' has no attribute Integral

,然后找到此解决方案:

https://github.com/numpy/numpy/issues/9872#issuecomment-337098073

基本上说我可能还有其他名为“ numbers.py”的文件,这些文件将与数字模块冲突。因此,有点愚蠢的是,我删除了除与numpy一起安装的所有文件之外的所有“ numbers.py”文件,现在出现此错误:

Traceback (most recent call last):

 File "/var/folders/hw/cyqjhjm96tg8954yh9lrq9380000gn/T/tmpvuuam3s5pycharm-management/setuptools-40.8.0/setup.py", line 11, in <module>
    import setuptools
  File "/private/var/folders/hw/cyqjhjm96tg8954yh9lrq9380000gn/T/tmpvuuam3s5pycharm-management/setuptools-40.8.0/setuptools/__init__.py", line 20, in <module>
    from setuptools.dist import Distribution, Feature
  File "/private/var/folders/hw/cyqjhjm96tg8954yh9lrq9380000gn/T/tmpvuuam3s5pycharm-management/setuptools-40.8.0/setuptools/dist.py", line 9, in <module>
    import numbers
ModuleNotFoundError: No module named 'numbers'

每当我尝试使用PyCharm(“无法创建解释器”)运行程序时,当我尝试在IDLE中运行它时,我都会得到

    Traceback (most recent call last):
  File "/Users/caleb/Documents/neuroanatomy comp lab py3 version.py", line 2, in <module>
    import numpy
  File "/Users/caleb/Library/Python/3.7/lib/python/site-packages/numpy/__init__.py", line 140, in <module>
    from . import core
  File "/Users/caleb/Library/Python/3.7/lib/python/site-packages/numpy/core/__init__.py", line 70, in <module>
    from . import numerictypes as nt
  File "/Users/caleb/Library/Python/3.7/lib/python/site-packages/numpy/core/numerictypes.py", line 566, in <module>
    _register_types()
  File "/Users/caleb/Library/Python/3.7/lib/python/site-packages/numpy/core/numerictypes.py", line 561, in _register_types
    numbers.Integral.register(integer)
AttributeError: module 'numbers' has no attribute 'Integral'

我现在不确定该怎么办。作为参考,我正在运行MacOS Catalina。 请帮助,计算机之神!

0 个答案:

没有答案