Set up a Python development environment with Visual Studio Code

0. Introduction

Previously, I wrote Qiita called Preparing an HTML creation environment using Visual Studio Code, but nowadays machine learning (including deep learning) is popular. Many books based on Python have been published (Amazon: Python Machine Learning Programming, [Amazon: Deep Learning from Zero-Deep Learning Learned with Python] Theory and implementation of](http://amzn.to/2n7hVb7), etc.). So this time I decided to prepare a Python development environment with Visual Studio Code.

The target version of Visual Studio Code is ** 1.10.2 **. The Python version is ** 3.6.0 **.

1. Install Python in a Windows environment

Use the package manager chocolatey. If chocolatey is not installed, install it with the following command.

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

The installation will be completed immediately. Relaunch the command prompt and install python with the choco command.

choco install python

1-2. Install Python extension in VS Code

The following add-ins for Python extensions have all the functionality needed for coding (debugging, intellisense, etc.).

Plugin Name and link Use
image Python Linting,Debugging(multi-threaded,remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.

Open the command palette with Ctrl + P in Visual Studio Code and execute the following command.

ext install Python

Select "Python" from the Extensions pane and click "Install".

1-3. Install Lint (PyLint)

Visual Studio Code seems to support multiple Lint tools, but this time I will install PyLint. (It seems to be standard Lint → DonJayamanne / pythonVSCode Linting Execute the following at the command prompt.

pip install pylint

Go back to Visual Studio Code and check if the settings to use pylint (File-> Basic settings-> Settings) are made.

settings.json


// Whether to lint Python files.
"python.linting.enabled": true,
// Whether to lint Python files using pylint.
"python.linting.pylintEnabled": true,

2. Conclusion

This completes the setup. I didn't get caught in particular.

reference

Recommended Posts

Set up a Python development environment with Visual Studio Code
Build Python development environment with Visual Studio Code
Python development environment with Windows + Anaconda3 + Visual Studio Code
Python development environment with Windows + Python + PipEnv + Visual Studio Code
Set up a Python development environment with Sublime Text 2
Try to create a python environment with Visual Studio Code & WSL
Set up a Python development environment on Marvericks
Create a Python development environment on Windows (Visual Studio Code remote WSL).
Create a simple Python development environment with VS Code and Docker
I want to set up a GUI development environment with Python or Golang on Mac
[Python] Build a Django development environment with Docker
Build a python execution environment with VS Code
Set up TinyGo development environment for VS Code
Get a quick Python development environment with Poetry
Python development in Visual Studio 2017
Python development in Visual Studio
Set up a development environment for natural language processing
How to set up a Python environment using pyenv
Create a python development environment with vagrant + ansible + fabric
Build a machine learning application development environment with Python
A note on speeding up Python code with Numba
[Vagrant] Set up a simple API server with python
A note I was addicted to when running Python with Visual Studio Code
Java with Visual Studio Code (Part 2)
Enable the virtualenv Python virtual environment for Visual Studio Code
Create a virtual environment with Python!
Prepare Python development environment with Mac + Windows + VisualStudio Code (Windows version)
Building a virtual environment with Python 3
Prepare Python development environment with Mac + Windows + VisualStudio Code (Mac version)
Do something like a Python interpreter in Visual Studio Code
Set up Python environment on CentOS
Get a clean Python development environment with pyenv + pipx + Poetry
How to build a python2.7 series development environment with Vagrant
Create a simple Python development environment with VSCode & Docker Desktop
Prepare Python development environment with Atom
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
Try it when Visual Studio Code can't load a Python module
Build jupyter notebook environment with Visual Studio Code (VS Code) Mac version
[Pyenv] Building a python environment with ubuntu 16.04
Building a Python3 environment with Amazon Linux2
Easily build a development environment with Laragon
[Development environment] Python with Xcode [With screen transition]
Set up a Samba server with Docker
[Python] Create a virtual environment with Anaconda
Building a Python 3.6 environment with Windows + PowerShell
Build a python virtual environment with pyenv
Build a modern Python environment with Neovim
Building a Python development environment for AI development
Prepare a Python virtual environment for your project with venv with VS Code
Use Jupyter Notebook with Visual Studio Code on Windows 10 + Python + Poetry + pyenv-win
I was addicted to creating a Python venv environment with VS Code
Send mail with mailx to a dummy SMTP server set up with python.
Steps to create a Python virtual environment with VS Code on Windows
Try to set up a Vim test environment quite seriously (for Python)
I tried to build a Mac Python development environment with pythonz + direnv
Set up a simple HTTPS server in Python 3
Build a C language development environment with a container
Set up a simple HTTPS server with asyncio
Building a python environment with virtualenv and direnv
Build a python environment with ansible on centos6