AttributeError:模块'numexpr'没有属性'__version__'

时间:2020-11-12 10:02:11

标签: python pandas

尝试导入下面编写的一些模块:

import numpy as np
import os.path
import pandas as pd
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

但是我得到AttributeError:模块'numexpr'没有属性' version ',我不知道该如何解决。我已经尝试卸载并安装numpy。我在下面添加了完整的错误消息,如果过长,我深表歉意。

AttributeError                            Traceback (most recent call last)
<ipython-input-1-c0202e9c9cc8> in <module>()
      1 import numpy as np
      2 import os.path
----> 3 import pandas as pd
      4 import math
      5 import matplotlib.pyplot as plt

~\Anaconda3\lib\site-packages\pandas\__init__.py in <module>()
     40 import pandas.core.config_init
     41 
---> 42 from pandas.core.api import *
     43 from pandas.core.sparse.api import *
     44 from pandas.stats.api import *

~\Anaconda3\lib\site-packages\pandas\core\api.py in <module>()
      8 from pandas.core.dtypes.missing import isnull, notnull
      9 from pandas.core.categorical import Categorical
---> 10 from pandas.core.groupby import Grouper
     11 from pandas.io.formats.format import set_eng_float_format
     12 from pandas.core.index import (Index, CategoricalIndex, Int64Index,

~\Anaconda3\lib\site-packages\pandas\core\groupby.py in <module>()
     44 from pandas.core.base import (PandasObject, SelectionMixin, GroupByError,
     45                               DataError, SpecificationError)
---> 46 from pandas.core.index import (Index, MultiIndex,
     47                                CategoricalIndex, _ensure_index)
     48 from pandas.core.categorical import Categorical

~\Anaconda3\lib\site-packages\pandas\core\index.py in <module>()
      1 # flake8: noqa
----> 2 from pandas.core.indexes.api import *
      3 from pandas.core.indexes.multi import _sparsify

~\Anaconda3\lib\site-packages\pandas\core\indexes\api.py in <module>()
----> 1 from pandas.core.indexes.base import (Index, _new_Index,  # noqa
      2                                  _ensure_index, _get_na_value,
      3                                  InvalidIndexError)
      4 from pandas.core.indexes.category import CategoricalIndex  # noqa
      5 from pandas.core.indexes.multi import MultiIndex  # noqa

~\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in <module>()
     50 import pandas.core.algorithms as algos
     51 from pandas.io.formats.printing import pprint_thing
---> 52 from pandas.core.ops import _comp_method_OBJECT_ARRAY
     53 from pandas.core.strings import StringAccessorMixin
     54 from pandas.core.config import get_option

~\Anaconda3\lib\site-packages\pandas\core\ops.py in <module>()
     17 from pandas import compat
     18 from pandas.util._decorators import Appender
---> 19 import pandas.core.computation.expressions as expressions
     20 
     21 from pandas.compat import bind_method

~\Anaconda3\lib\site-packages\pandas\core\computation\__init__.py in <module>()
      8 try:
      9     import numexpr as ne
---> 10     ver = ne.__version__
     11     _NUMEXPR_INSTALLED = ver >= LooseVersion(_MIN_NUMEXPR_VERSION)
     12 

AttributeError: module 'numexpr' has no attribute '__version__'

1 个答案:

答案 0 :(得分:0)

前一段时间我遇到了相同的问题,并通过在Ananconda中执行以下操作来解决了该问题:

pip uninstall -y numpy
pip uninstall -y setuptools
pip install setuptools
pip install numpy

如果您使用的是Anaconda3,请使用pip3尝试相同的操作。