不停% 2021-06-23 23:01 采纳率: 66.7%
浏览 860
已采纳

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
    关注

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

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)