At any time, you always have the option to switch between the Docker container's default Python version and that of Miniconda.Did I forget to mention that you can also create and activate your own Python Application environments with conda? Isolation again!.This is when the combined power of Miniconda and Docker becomes a great solution! There are also many use cases where a Python application running on Miniconda seeks non-Python host-side dependencies (for example g++).Though Python 2 is officially dead, you can still test older applications on top of this environment without needing to audit your new Python 3 port with 2to3. Miniconda allows you to install both Python 2 and Python 3 applications.With it, you can run conda install python=3.7 to change the Python version required by installing it with all dependencies necessary. This is a huge help for developers of applications that are based on say different versions of Python 3: They could be 3.6, 3.7, 3.8, 3.9 or earlier versions too.įor example, if by default you're running Python 3.9 but your Python application requires Python 3.7 because of relevant dependencies, what would you do? So, this provides you an added level of isolation when done on a Docker container.ĭue to the above point, you also get another advantage: Since you are using conda that Miniconda installed, you can use this tool to change the relevant Python version of your application as and when needed. Miniconda installs on a separate location having its own Python environment. When you install Miniconda on a host, you are not actually using the Python version provided by the operating system's package manager. Miniconda is a free minimal installer for conda and gives you a small, bootstrap version of Anaconda with just the bare-bones necessities you need to run Python applications. So, you can bid goodbye to those host-based installation hiccups! Creating a docker image for your Python application You'll be able to straightaway run your Python application with Docker every single time. Once you've modified and revised that image, you'll no longer need to worry about installing your Python Application on different operating systems. This is going to be useful for both users and developers. In this tutorial, I will show you how to follow the same idea but for Python applications alone.
0 Comments
Leave a Reply. |