不停%
2021-06-23 23:01
采纳率: 100%
浏览 103

Can't determine version for numexpr

在matlab中出现下面的错误,该如何解决???

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-83-9cad6bc84e8c> in <module>
      8 cumsum_evr = np.cumsum(evr)
      9 
---> 10 ax = sns.lineplot(x=np.arange(0,len(cumsum_evr)),y=cumsum_evr,label='Explained Variance Ratio')
     11 ax.set_title('Explained Variance Ratio Using {} Components'.format(N_COMPONENTS))
     12 ax = sns.lineplot(x=np.arange(0,len(cumsum_evr)),y=evr,label='Explained Variance Of Component X')

D:\ProgramData\Anaconda3\lib\site-packages\seaborn\_decorators.py in inner_f(*args, **kwargs)
     44             )
     45         kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
---> 46         return f(**kwargs)
     47     return inner_f
     48 

D:\ProgramData\Anaconda3\lib\site-packages\seaborn\relational.py in lineplot(x, y, hue, size, style, data, palette, hue_order, hue_norm, sizes, size_order, size_norm, dashes, markers, style_order, units, estimator, ci, n_boot, seed, sort, err_style, err_kws, legend, ax, **kwargs)
    701     p._attach(ax)
    702 
--> 703     p.plot(ax, kwargs)
    704     return ax
    705 

D:\ProgramData\Anaconda3\lib\site-packages\seaborn\relational.py in plot(self, ax, kws)
    481             # matplotlib to show "gaps" in the line when all values are missing.
    482             # This is straightforward absent aggregation, but complicated with it.
--> 483             sub_data = sub_data.dropna()
    484 
    485             # Due to the original design, code below was written assuming that

D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py in dropna(self, axis, how, thresh, subset, inplace)
   5168             mask = count >= thresh
   5169         elif how == "any":
-> 5170             mask = count == len(agg_obj._get_axis(agg_axis))
   5171         elif how == "all":
   5172             mask = count > 0

D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\ops\common.py in new_method(self, other)
     63         other = item_from_zerodim(other)
     64 
---> 65         return method(self, other)
     66 
     67     return new_method

D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\arraylike.py in __eq__(self, other)
     27     @unpack_zerodim_and_defer("__eq__")
     28     def __eq__(self, other):
---> 29         return self._cmp_method(other, operator.eq)
     30 
     31     @unpack_zerodim_and_defer("__ne__")

D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\series.py in _cmp_method(self, other, op)
   4976         rvalues = extract_array(other, extract_numpy=True)
   4977 
-> 4978         res_values = ops.comparison_op(lvalues, rvalues, op)
   4979 
   4980         return self._construct_result(res_values, name=res_name)

D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\ops\array_ops.py in comparison_op(left, right, op)
    248             warnings.simplefilter("ignore", DeprecationWarning)
    249             with np.errstate(all="ignore"):
--> 250                 res_values = _na_arithmetic_op(lvalues, rvalues, op, is_cmp=True)
    251 
    252     return res_values

D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\ops\array_ops.py in _na_arithmetic_op(left, right, op, is_cmp)
    137     TypeError : invalid operation
    138     """
--> 139     import pandas.core.computation.expressions as expressions
    140 
    141     try:

D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expressions.py in <module>
     16 from pandas.core.dtypes.generic import ABCDataFrame
     17 
---> 18 from pandas.core.computation.check import NUMEXPR_INSTALLED
     19 from pandas.core.ops import roperator
     20 

D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\check.py in <module>
      1 from pandas.compat._optional import import_optional_dependency
      2 
----> 3 ne = import_optional_dependency("numexpr", raise_on_missing=False, on_version="warn")
      4 NUMEXPR_INSTALLED = ne is not None
      5 if NUMEXPR_INSTALLED:

D:\ProgramData\Anaconda3\lib\site-packages\pandas\compat\_optional.py in import_optional_dependency(name, extra, raise_on_missing, on_version)
    113     minimum_version = VERSIONS.get(name)
    114     if minimum_version:
--> 115         version = get_version(module)
    116         if distutils.version.LooseVersion(version) < minimum_version:
    117             assert on_version in {"warn", "raise", "ignore"}

D:\ProgramData\Anaconda3\lib\site-packages\pandas\compat\_optional.py in get_version(module)
     54 
     55     if version is None:
---> 56         raise ImportError(f"Can't determine version for {module.__name__}")
     57     return version
     58 

ImportError: Can't determine version for numexpr

采用了这个博客的方法也没有解决.ImportError: Can't determine version for bottleneck_茧将的博客-CSDN博客

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • 不停% 2021-06-29 15:19
    已采纳

    由于我要完成作业,通过浏览了大量文档,我觉得应该是我当时手贱,不小心升级了某个库,导致包之间版本有冲突。然后我就直接删了所以库,重新安装。然后就没有出现这个问题了。

    虽然有点笨,但也不失为一种解决方法。简单暴力。

    点赞 打赏 评论
  • 有问必答小助手 2021-06-28 19:10

    你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答

    本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。

    ​​​​因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。

    点赞 打赏 评论

相关推荐 更多相似问题