1

Oftentimes installing some package causes my whole anaconda distribution to crash. One instance where I faced such issue is when I do:

$ ipython --pylab

Then, I get

segmentation fault (core dumped)

This is usually because of some package mismatch/error. To resolve such situations the whole packages has to be re-installed in my anaconda distribution.

Fortunately, I usually take the list of packages that I install in my base conda environment using:

$ conda list --export > conda_packages.txt

So, how can I re-installed all packages at once using this conda_packages.txt file? So that I don't have to manually install each package from this file.

Is there a short command line option for achieving this in *nix, particularly in Ubuntu?

kmario23
  • 57,311
  • 13
  • 161
  • 150

1 Answers1

1

After struggling for some time, I managed to solve this problem with:

# assumes that anaconda is installed in ~/anaconda3
conda create -p /home/user/anaconda3/envs --file conda_packages.txt

This would install all the packages in conda_packages.txt to the base conda environment.


To install it in a particular env, use:

conda create --name /home/user/anaconda3/envs/<your_env_name> --file conda_packages.txt
kmario23
  • 57,311
  • 13
  • 161
  • 150
  • For me the command above removed all exisiting enviroment, I had to run `conda update --file conda_packages.txt` to make it updated base – mmoisse May 23 '21 at 08:33