Docker interpreter in IDE

We put a development environment for training AI models in a Docker container for LearnIoTAI. The Python interpreter with AI packages such as Tensorflow and Pytorch is in the Docker container. To use the Python interpreter inside the Docker container through an Integrated Development Environment (IDE) we need to select the containerized Python interpreter from the IDE.

Launch the iotai_train Docker container with the alias iotain_train and open pycharm.sh from inside the container. Go to Settings Python Interpreter to select an interpreter.

Set Python Interpreter for the project.

Select the Python Interpreter in the container. After selecting the interpreter the available Python packages will appear.

Select Python interpreter and see available packages.

Microsoft Visual Studio Code

MS Code comes with containerized interpreter connection ability. In Microsoft Visual Studio Code Connect to a running container: CRTL-SHIFT-P -> Remote-Containers: Attach to Running Container…

Select running Docker container

Container runs interpreter for the integrated development environment (IDE).

Select interpreter in container.

Container interpreter

Container running interpreter at top of IDE.

Container running as interpreter for the IDE

Now you can develop and run Python code with all the packages from the LearnIoTAI container.

Published by LearnIoTAI

A partnership of technology professionals sharing their knowledge of Artificial Intelligence (AI) and Internet of Things (ioT) devices helping people get started in the convergence of these two growing and exciting fields.

Leave a comment

Design a site like this with WordPress.com
Get started