Easy Python data analysis environment construction with Windows10 Pro x VS Code x Docker

Overview

You hate building an environment, right? I hate it at a crazy level because I'm a bad person who makes errors and takes a few days without hesitation. If I try to get a non-engineer who works with me to do analysis work that I am a weak but crazy engineer, I may be stabbed from behind. That's why I made a title that seems to be able to be diverted to some extent, so I will also post it as a memorandum.

** Providing non-engineers with an environment where they can write Python like Jupyter Notebook on VS Code **

I am aiming for that.

It might be good for such a person to read

――I want to easily create a Python environment --I want to use Visual Studio Code mainly ――I don't want to devote effort to building the environment ――I want non-engineers to easily analyze data using Python. ――If you can, I only want to use the mouse (I don't want to)

(We do not explain each software or technical details)

Prerequisite environment

OS: Windows 10 Pro 64bit (to use Hyper-V function when using Docker)

Environment

Roughly, the following flow.

  1. Get the folder structure that is the basis of the environment
  2. Install and set up Docker Desktop for Windows
  3. Installation and setup of Visual Studio Code
  4. Environment creation

1. Get the folder structure that is the basis of the environment

I prepared a folder structure to be used as a base and a group of necessary files on GitHub, so I cloned it or downloaded it and placed it in any folder (in my case, I created a folder for Git under C drive) https://github.com/m0p1nt/ds_base_env_for_vscode

Change the value of the name attribute of devcontainer.json to your liking. image.png

2. Install and set up Docker Desktop for Windows

Since other contributors have already written articles that are easy to understand for environment construction, only the rough procedure (reference site is in the supplement below).

  1. Enable Hyper-V Check Hyper-v in the Control Panel-> Programs and Features-> Enable or Disable Windows Features item (Restart when prompted) ). image.png

  2. Download and install the installer from Docker Desktop for Windows Download Site image.png

  3. Drive mount settings
    (1) Open the setting screen with [Setting] from the Docker icon at the bottom right of the Widndows taskbar (if there is no icon, start Docker and check again). image.png
    (2) Check the mount permission for the drive where the folder for the analysis environment is placed. image.png

3. Installation and setup of Visual Studio Code

  1. Download and install the installer from Visual Studio Code Download Site

  2. Add extension Remote --Containers image.png

4. Environment creation

  1. Click the green icon at the bottom left of the VS Code screen and select Remote-Containers: Open Folder in Container .... image.png

Select the folder placed in "1. Get the folder structure that is the base of the environment" above. image.png

A new screen will be launched and the environment construction will start, so wait a few minutes and you're done. image.png

It is convenient because it can be used like Jupyter Notebook on VS Code. image.png

To close it, click the green icon at the bottom left and select End remote connection. image.png

Supplement

--If you want to add a Python library → Install with pip command on VS Code terminal image.png If you want others to see the addition of the library, on the VS Code terminal, $ pip freeze > .devcontainer/requirements.txt You can list the installed libraries with.

--If you want to add VS Code extensions → Edit the extensions attribute of devcontainer.json image.png The name corresponds to the value in the figure below that is displayed when searching for an extension. (Example: For extension Python) image.png

Referenced

-Microsoft vscode dev containers (reference for folder structure)

-[Note] [Docker Struggle: 1] Docker for Windows installation (Docker Desktop for Windows installation reference)

Recommended Posts

Easy Python data analysis environment construction with Windows10 Pro x VS Code x Docker
Python (Windows 10) Virtual Environment / Package with VS Code
Make your Python environment "easy" with VS Code
Python with VS Code (Windows 10)
Data analysis environment construction with Python (IPython notebook + Pandas)
Python local development environment construction template [Flask / Django / Jupyter with Docker + VS Code]
Data science environment construction with Docker
Create a simple Python development environment with VS Code and Docker
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Easy construction]
Steps to create a Python virtual environment with VS Code on Windows
Use Python in Anaconda environment with VS Code
Build a python execution environment with VS Code
Data analysis with python 2
python windows environment construction
Data analysis with Python
Virtual environment construction with Docker + Flask (Python) + Jupyter notebook
[Python] OpenCV environment construction with Docker (cv2.imshow () also works)
From Kafka to KSQL --Easy environment construction with docker
Python development environment with Windows + Python + PipEnv + Visual Studio Code
Debug Python with VS Code
Prepare python3 environment with Docker
Python environment construction under Windows7 environment
Environment construction for those who want to study python easily with VS Code (for Mac)
OpenJTalk on Windows10 (Speak Japanese with Python from environment construction)
Golang + Gin + Docker hot reload, VS Code debugging environment construction
Prepare Python development environment with Mac + Windows + VisualStudio Code (Windows version)
Prepare Python development environment with Mac + Windows + VisualStudio Code (Mac version)
The story that Python stopped working with VS Code (Windows 10)
Build a Python environment with WSL + Pyenv + Jupyter + VS Code
Execute C ++ functions from Python with Pybind11 (for Windows & Visual Studio Code people) Environment construction
Python environment construction memo on Windows 10
Get started with Python! ~ ① Environment construction ~
Anaconda python environment construction on Windows 10
Build Mysql + Python environment with docker
Easy Jupyter environment construction with Cloud9
[Python3] Development environment construction << Windows edition >>
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
Easy data visualization with Python seaborn.
pytorch @ python3.8 environment construction with pipenv
Data analysis starting with python (data visualization 1)
[docker] python3.5 + numpy + matplotlib environment construction
Data analysis starting with python (data visualization 2)
Install python with mac vs code
Create a Python environment for professionals in VS Code on Windows
How to build Python and Jupyter execution environment with VS Code
Create a USB boot Ubuntu with a Python environment for data analysis
LaTeX and R (a little Python) environment construction with SublimeText3 (Windows)
[Windows 10] [Development environment construction] How to resolve when unresolved import'django.xxx' python (unresolved-import) occurs in VS Code
Comfortable Jupyter Lab (Python) analysis environment created with Docker + VSCode + Remote Container
Data pipeline construction with Python and Luigi
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Build Jupyter Lab (Python) environment with Docker
How to debug a Python program by remotely connecting to a Docker container in WSL2 environment with VS Code
Python project environment construction procedure (for windows)
Using venv in Windows + Docker environment [Python]
I was addicted to creating a Python venv environment with VS Code
Building a Python 3.6 environment with Windows + PowerShell
Build a development environment using Jupyter and Flask with Python in Docker (supports both VS Code / code-server)
Create Python + uWSGI + Nginx environment with Docker
VScode environment construction (Windows10, Python, C ++, C, Git)
Data analysis starting with python (data preprocessing-machine learning)