Prepare Python development environment with Mac + Windows + VisualStudio Code (Windows version)

I decided to develop a web application with Python with an acquaintance, so I made a memorandum.

There is a Mac version of the article in a similar article. (Mac version article)

Create in the following environment so that all members can use the PC owned by the member for free because there are multiple environments of Mac and Windows. For the time being, create up to Intellisense debug execution with VSCODE.

Development environment (confirmed)

・ IDE
VSCode version 1.8.1
·language
  Python3
  Django 1.10.4
・ OS
  Windows10

Environment creation

I am working with reference to this article (thanks) Introduction to Python Django (1)Introduction to Python Django (2) Win

Python Path and Version pythonVSCode some virtualenv issues #148 Troubleshooting Intellisense Autocompletion

Windows version

1. 1. Python installation

Bring the installer from the Python site and install it. Note that if you forget to check Add Python 3.6 to PATH, it will be troublesome.

2. Install virtualenv

C:\Users\hoge>pip install virtualenv

3. 3. Create Env folder for development environment

C:\Users\hoge>mkdir sandbox
C:\Users\hoge\sandbox>cd sandbox
C:\Users\hoge\sandbox>mkdir python
C:\Users\hoge\sandbox>cd python
C:\Users\hoge\sandbox\python>virtualenv env1

4. Use of env1

C:\Users\hoge\sandbox\python>cd env1
C:\Users\hoge\sandbox\python\env1>Scripts¥activate
(env1) C:\Users\hoge\sandbox\python\env1>

(env1) is successful

5. Django installation

(env1) C:\Users\hoge\sandbox\python\env1>pip install django==1.10.4
(env1) C:\Users\hoge\sandbox\python\env1>pip freeze -l
Django==1.10.4

6. Create a development site

(env1) C:\Users\hoge> cd Documents\Develop\pythonSites
(env1) C:\Users\hoge\Documents\Develop\pythonSites> django-admin.py startproject myTestSite

Please choose the development folder to your liking. In the above, you will have C: \ Users \ hoge \ Documents \ Develop \ pythonSites / myTestSite.

7. Install Visual Studio Code

A. Download and install the package

Download and install from Visual Studio Code

I. Install extension

Install Python by typing Python from View> Extensions (Don Jayamanne's guy) スクリーンショット 2017-01-09 13.35.37.png

8. Start and set Visual Studio Code

A. Launch VsCode

C:\Users\hoge>cd sandbox\python\env1
C:\Users\hoge\sandbox\python\env1>Scripts¥activate
(env1) C:\Users\hoge\sandbox\python\env1> cd C:\Users\hoge\Documents\Develop\pythonSites
(env1) C:\Users\hoge\Documents\Develop\pythonSites>"C:\Program Files (x86)\Microsoft VS Code\Code.exe" .

Note that if you do not use the above login method, the default virtual environment settings and other settings will be incorrect.

I. Add workspace definition

setting.js


//Insert settings in this file to override the default and user settings
{
    "python.pythonPath": "C:/Users/hoge/sandbox/python/env1/Scripts/python.exe",
    "python.linting.pylintEnabled": false,
    "python.linting.pep8Enabled": true
}

Set to enable intellisense and debugging environment. The location of the file is File> Preferences> Workspace Settings. Set only when you open this workspace.

Unlike the Mac version, the windows version is a simple specification that ends with this setting ... I envy

C. Debug function settings

For the time being, in order to create a template file, click the debug icon from the menu on the left and forcibly execute debugging.

9. End of Windows version

If you do so far, intellisense 2017-01-09.png

Debug execution 2017-01-09 (2).png

Ready mouse. After all it is MS, I feel that the Windows version is a little better.

Recommended Posts

Prepare Python development environment with Mac + Windows + VisualStudio Code (Windows version)
Prepare Python development environment with Mac + Windows + VisualStudio Code (Mac version)
Python development environment with Windows + Anaconda3 + Visual Studio Code
Python development environment with Windows + Python + PipEnv + Visual Studio Code
Prepare Python development environment with Atom
Build Python development environment with Visual Studio Code
Python (Windows 10) Virtual Environment / Package with VS Code
Python with VS Code (Windows 10)
Prepare python3 environment with Docker
Prepare Python development environment on Ubuntu
Set up a Python development environment with Visual Studio Code
Prepare your first Python development environment
[Python3] Development environment construction << Windows edition >>
Install Python development environment on Windows 10
Install python with mac vs code
Prepare the development environment with anyenv
[Python Windows] pip install with Python version
Create a simple Python development environment with VS Code and Docker
Build jupyter notebook environment with Visual Studio Code (VS Code) Mac version
[Python] Building an environment with Anaconda [Mac]
[Development environment] Python with Xcode [With screen transition]
Building a Python 3.6 environment with Windows + PowerShell
Build Python environment with Anaconda on Mac
Prepare the development environment for keyhac for Mac
Windows + gVim + Poetry python development environment construction
python windows environment
Prepare a Python virtual environment for your project with venv with VS Code
Prepare Python development environment for each project in Windows environment (VSCode + virtualEnvWrapper + Pylint)
Create a Python development environment on Windows (Visual Studio Code remote WSL).
Steps to create a Python virtual environment with VS Code on Windows
I tried to build a Mac Python development environment with pythonz + direnv
Introduction to Python Let's prepare the development environment
Prepare the execution environment of Python3 with Docker
Manage Python multiple version environment with Pythonz, virtualenv
[Python] Build a Django development environment with Docker
Image Processing with Python Environment Setup for Windows
Build a Python development environment on your Mac
Use Python in Anaconda environment with VS Code
Create a Python virtual development environment on Windows
Make your Python environment "easy" with VS Code
Build a python execution environment with VS Code
Get a quick Python development environment with Poetry
Create a Python development environment in 10 minutes (Mac OS X + Visual Studio Code)
Character code for reading and writing csv files with python ~ windows environment ver ~
Python local development environment construction template [Flask / Django / Jupyter with Docker + VS Code]
Easy Python data analysis environment construction with Windows10 Pro x VS Code x Docker
Build a local development environment with WSL + Docker Desktop for Windows + docker-lambda + Python
python windows environment construction
Python development environment construction
Python starting with Windows 7
Prepare a development environment that is portable and easy to duplicate without polluting the environment with Python embeddable (Windows)
About Python development environment
Python environment with docker-compose
python2.7 development environment construction
Development environment in Python
Mac environment construction Python
Virtual environment with Python 3.6
Check version with python
Virtualize (isolate) IBM i python development environment with chroot
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
Allow real-time code checking in Python development with VS Code