简体   繁体   中英

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

Trying to import some modules written below:

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

However I get an AttributeError: module 'numexpr' has no attribute ' version ' which I don't know how to solve. I've already tried to uninstall and install numpy. I've added the full error message below I apologize if it's a bit lengthy.

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__'

I experienced the same problem a while back and solved it by doing the following thing in Ananconda :

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

If you are using Anaconda3 try the same thing using pip3 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM