2

I am a dual boot user, I use Ubuntu18.04 and Windows 10. I also have a parrot Linux running in VM inside ubuntu. Very Obviously I have a problem with tools sync across these platforms.

I have an ongoing demand in this regard. I want to sync all my anaconda installations i.e. I need an option to enlist and trigger my anaconda packages of windows to get automatically installed in Ubuntu or vice versa.

I have searched a bit on the internet, but didn't find something related. Any way to do it?

1 Answer 1

2

I would recommend you start using conda environments. Additionally using a git repository to keep track of your different environment specifications wouldn't hurt.
Alternatively as it's all one machine you could setup a location that is accessible to both Windows and Linux and store the environment specification files there.

Create environment on Windows and re-create it on Linux

Windows

In Windows you could for example create an environment with python 3.7, pandas and numpy and plotly:

conda create --name myenv python=3.7 pandas numpy plotly

Then you would export that environment to a .yml file:

conda activate myenv
conda env export > myenv.yml

Linux

Now on Linux you can create the same environment by using that .yml file.

conda env create -f myenv.yml

You could place that .yml file in git and sync it easily between the different OS'es.

Updating an environment

Linux

Now say you've added a package or two when in Linux to myenv:

conda activate myenv
conda install matplotlib beautifulsoup4

You need to re-export that environment to a new specification .yml file with:

conda activate myenv
conda env export > myenv.yml

Windows

Now on Windows you can get that newly created myenv.yml and use it to sync up the Windows conda environment:

conda activate myenv
conda env update -f myenv.yml --prune
5
  • Thanks Lindestøkke for this suggestion. I didn't really think this way of sharing my configurations using github, But it could be easier if this could be automated than bothering to use the commands using some tool. Currently, I would be using dropbox to sync my configuration file in your suggested way. But a more robust automation is still sought. Also nam mapping the correct env in case of multiple env is going to be a trouble.
    – Sayan Dey
    Commented Aug 16, 2020 at 14:58
  • All these commands can be automated to be run every n-minutes, resulting in an automated solution. As you have two different OS'es I don't think there's another way. You can't simply share the library files directly as they are different per OS. Also, if keeping track of different environments via "name mapping" is too difficult, one has to wonder if your current set-up is too complex. Commented Aug 16, 2020 at 15:10
  • "There is no other way" - I feel there should be, I use VS Code, and have the same problem with configuration setup, there is an extension to do it on vs code with one click settings-sync. Was looking for something alike. Thanks for your solution though. And I have multiple environments for professional and personal space and sub-usecase for them as well. Which is why I am looking for a sync-soultion.
    – Sayan Dey
    Commented Aug 17, 2020 at 10:12
  • I don't the comparison between settings of an application with a whole package manager is fair. The latter is far more complex. If you find something though, I look forward to see it as an answer. Commented Aug 17, 2020 at 10:21
  • Sure. Just to be accurate, not settings actually, it takes up all your extenstions in vs code. Also I get your point. But my trouble is to automate syncing and reproducing that yml only. rest(installation) is easy.Again thanks for your method.
    – Sayan Dey
    Commented Aug 17, 2020 at 11:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .