When it comes to creating a machine learning environment with Python, there are a lot of articles saying "Install Anaconda", but in reality, the minimum configuration version of Anaconda called Miniconda is sufficient for environment construction. It is an article that conveys that.
Basically, the following is sufficient.
conda create -n ml_env numpy scipy scikit-learn matplotlib jupyter
Actually, there are subtle differences depending on whether it is Mac or Windows, so please refer to here for details.
Also, please refer to here for how to use the conda
command to create a development environment.
If you want to develop with Docker, Miniconda's official Dockerfile is provided. You can create your own container immediately by inheriting this Dockerfile with FROM
and then adding additional libraries as you like with the commands conda
and pip
.
If you want to use TensorFlow or Chainer, you can do an additional pip install
.
Anaconda is honestly too heavy. With Miniconda, you can select as much as you need, so the capacity of the development environment is about 500 to 600M, but compared to this, Anaconda takes 2 to 3G just by installing it. And there are a lot of libraries in it that you don't use.
And you don't even know which libraries your code depends on. Even if you decide to deploy it somewhere, Anaconda has many libraries installed by default, so you will not know which library it depends on. With Miniconda, you can find the required libraries for each environment. Of course, Anaconda can also create an environment for each individual project, but then Miniconda is fine.
That's all from the field.
Recommended Posts