首页 \ 问答 \ Biopython,导入错误与“导入生物”(Biopython, import error with “import Bio”)

Biopython,导入错误与“导入生物”(Biopython, import error with “import Bio”)

我在Windows上安装了Anaconda Biopython

当我尝试import Bio此错误:

ModuleNotFoundError: No module named 'Bio'

为什么?


I have installed Biopython by Anaconda on Windows.

When I try import Bio I get this error:

ModuleNotFoundError: No module named 'Bio'

Why?


原文:https://stackoverflow.com/questions/47617644
更新时间:2023-04-02 10:04

最满意答案

鉴于您将数据实现为树的方式,为什么不将'TreeViewItem.IsExpanded`依赖项属性绑定到您自己的节点上的bool属性?

它至少需要是一个INotifyPropertyChanged属性,因此Node需要实现INotifyPropertyChanged

在Silverlight 5中,您可以设置这样的样式以绑定到IsExpanded属性:

<Style TargetType="sdk:TreeViewItem" x:Key="itemStyle">
    <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
</Style>

并使用

ItemContainerStyle="{Binding Source={StaticResource itemStyle}}"

在Silverlight 4中有许多变通方法。


Given the way you are implementing your data as a tree, why not bind the 'TreeViewItem.IsExpanded` dependency property to a bool property on your own Node?

It will need to be an INotifyPropertyChanged property at a minimum so Node will need to implement INotifyPropertyChanged.

In Silverlight 5 you can just set a style like this to bind to the IsExpanded property:

<Style TargetType="sdk:TreeViewItem" x:Key="itemStyle">
    <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
</Style>

And use with

ItemContainerStyle="{Binding Source={StaticResource itemStyle}}"

In Silverlight 4 there are a number of workarounds.

相关问答

更多
  • 看起来这个问题在这个时候仍然没有解决。 我在Microsoft Connect上打开了一个错误报告,如果此问题对您很重要,请将其投票! https://connect.microsoft.com/VisualStudio/feedback/details/613221/expanded-collapsed-state-not-saved-after-closing-file Looks like this issue will stay unresolved at this time. I opened a ...
  • 关于这个问题的代码项目有一篇很好的文章。 三态TreeView控件 There's a nice article on code project about just this. Tri-State TreeView Control
  • 您可以在与树的每个节点关联的ViewModel中保存这些信息,如下所示: public class PersonViewModel { readonly List _children = new List(); private bool _isExpanded; public IList Children { get { return _children; } } public string ...
  • 最简单的方法是将TreeViewItem.IsExpanded属性绑定到ViewModel,然后通过模型并计算。 我为你写了一个例子。 它计算扩展节点的数量,但你可以用扩展的人做任何你想做的事...... C#: using System; using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows; namespace WpfApplication1 { public partial ...
  • 为什么不通过执行与描述相同的操作来恢复状态,首先将子节点设置为展开状态,然后根据需要将它们的父节点设置为折叠状态? 与当前代码唯一的区别是使用两次迭代而不是一次。 首先在需要的地方迭代并展开,然后在需要的地方进行迭代和折叠。 无论如何,由于重绘逻辑,树应该绘制一次。 Why not restore the state by performing the same actions as described, first set the sub nodes to expanded then set their ...
  • 好的,我现在明白了。 由于此版本的jquery treeview是从实际的html元素(您将转换为可折叠树的UL)初始化的,因此由于某些原因对display属性敏感。 我的UL在DIV里面有显示:没有页面加载(我会用一个按钮切换它,以便在需要时淡入)。 事实证明,这会将节点状态搞砸到正确显示的位置,但插件会反向读取它们(导致两个+/-图标,并且函数全部展开/全部折叠以反转方式运行)。 我的解决方案是为我的DIV使用负左位置而不是显示属性,它就像一个魅力=) Ok, I got it now. Since t ...
  • 旧版本有bug。 适用于jsTree版本 - v3.3.1 - 2016-05-05 https://github.com/vakata/jstree/releases/tag/3.3.1 There are bug in old version. Works on version jsTree - v3.3.1 - 2016-05-05 https://github.com/vakata/jstree/releases/tag/3.3.1
  • 将'ContentPresenter'替换为'image'控件,并将图标文件的路径绑定到'image'控件的'source'属性。 replace the 'ContentPresenter' with the 'image' control,and bind the path of the your icon file to the 'source' property of your 'image' control.
  • 鉴于您将数据实现为树的方式,为什么不将'TreeViewItem.IsExpanded`依赖项属性绑定到您自己的节点上的bool属性? 它至少需要是一个INotifyPropertyChanged属性,因此Node需要实现INotifyPropertyChanged 。 在Silverlight 5中,您可以设置这样的样式以绑定到IsExpanded属性: