在代码块中使用 open() 系统调用时出现“没有这样的文件或目录”错误

问题描述

我试图在 Windows 10 PC 中的 c 程序上的代码块 IDE 上打开一个 png 文件,但我收到“没有这样的文件或目录”错误,尽管我在该文件夹中有图像。我已经尝试将路径包含在内,但仍然遇到相同的错误

def scatter_feature(data,feature_name):
    """
    This function returns a scatter plot for the particular `feature_name` v Price
    `data` should be a `DataFrame`
    `feature_name` should be a string
    """
    scatter = Scatter(data,x= feature_name,y='Price',xlabel=feature_name,ylabel='Price')
    
    output_file('scatter.html')
    
    return scatter
    
show(scatter_feature(data,'Mileage'))
show(scatter_feature(data,'Year'))



AttributeError                            Traceback (most recent call last)
<ipython-input-109-97dc81ee03de> in <module>()
     11     return scatter
     12 
---> 13 show(scatter_feature(data,'Mileage'))
     14 show(scatter_feature(data,'Year'))

/opt/conda/lib/python3.5/site-packages/bokeh/io.py in show(obj,browser,new,notebook_handle)
    297     '''
    298     if obj not in _state.document.roots:
--> 299         _state.document.add_root(obj)
    300     return _show_with_state(obj,_state,notebook_handle=notebook_handle)
    301 

/opt/conda/lib/python3.5/site-packages/bokeh/document.py in add_root(self,model,setter)
    526             self._roots.append(model)
    527         finally:
--> 528             self._pop_all_models_freeze()
    529         self._trigger_on_change(RootAddedEvent(self,setter))
    530 

/opt/conda/lib/python3.5/site-packages/bokeh/document.py in _pop_all_models_freeze(self)
    383         self._all_models_freeze_count -= 1
    384         if self._all_models_freeze_count == 0:
--> 385             self._recompute_all_models()
    386 
    387     def _invalidate_all_models(self):

/opt/conda/lib/python3.5/site-packages/bokeh/document.py in _recompute_all_models(self)
    393         new_all_models_set = set()
    394         for r in self.roots:
--> 395             new_all_models_set = new_all_models_set.union(r.references())
    396         old_all_models_set = set(self._all_models.values())
    397         to_detach = old_all_models_set - new_all_models_set

AttributeError: 'nonetype' object has no attribute 'references'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)