在基础anaconda环境中安装包

时间:2018-06-07 19:14:18

标签: python segmentation-fault anaconda packages conda

经常安装一些软件包导致我的整个anaconda发行版崩溃。我遇到这种问题的一个例子就是我:

$ ipython --pylab

然后,我得到了

  

分段错误(核心转储)

这通常是因为某些程序包不匹配/错误。要解决这种情况,必须在我的anaconda发行版中重新安装整个软件包。

幸运的是,我通常使用以下命令获取我在 base conda环境中安装的软件包列表:

$ conda list --export > conda_packages.txt

那么,如何使用此 conda_packages.txt 文件一次性重新安装所有软件包?这样我就不必从这个文件中手动安装每个包了。

在* nix中是否有一个简短的命令行选项来实现这一点,特别是在Ubuntu中?

1 个答案:

答案 0 :(得分:1)

经过一段时间的努力,我设法解决了这个问题:

func setup() {
    self.backgroundColor = UIColor.clear
    self.backgroundColor = UIColor.Custom.ligthGray
    self.clipsToBounds = true
    self.layer.cornerRadius = self.cornerRadius

    let alignedFlowLayout = AlignedCollectionViewFlowLayout(horizontalAlignment: .left, verticalAlignment: .top)
    alignedFlowLayout.minimumLineSpacing = 5.0
    alignedFlowLayout.minimumInteritemSpacing = 7.0
    alignedFlowLayout.sectionInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)

    self.collectionView.collectionViewLayout = alignedFlowLayout
    self.collectionView.translatesAutoresizingMaskIntoConstraints = false

    self.collectionView.delegate = self
    self.collectionView.dataSource = self
    self.collectionView.backgroundColor = UIColor.clear
    self.collectionView.isScrollEnabled = false

    self.collectionView.register(UINib(nibName: "RemovableTagCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "RemovableTagCollectionViewCell")

    self.addSubview(self.collectionView)

    self.collectionView.leadingAnchor.constraint(equalTo: self.leadingAnchor).isActive = true
    self.collectionView.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true
    self.collectionView.topAnchor.constraint(equalTo: self.topAnchor).isActive = true
    self.collectionView.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true
}

这会将# assumes that anaconda is installed in ~/anaconda3 conda create -p /home/user/anaconda3/envs --file conda_packages.txt 中的所有软件包安装到 conda_packages.txt conda环境中。

要将其安装在特定的base中,请使用:

env