python windows environment construction

◆ Building a python development environment using VS Code in a windows environment

・ Construction environment   windows10   python   VSCode   tortoiseGit

・ Reference site Python Environment Construction Guide  https://www.python.jp/install/windows/install.html


◆ python body

  1. Download    https://www.python.org/downloads/ Check "Add Python 3.x to PATH" during installation

  2. Check the main unit after installation    C:\Users\testuser1>python    quit()

  3. Python launcher confirmation    C:\Users\testuser1>py    quit()


◆VScode

  1. Download and install   https://code.visualstudio.com/download

  2. Launch the editor and add extensions ・ Japanese Language Pack for Visual Studio Code ・ Git Graph


◆ Create python sample code sample.py (If you don't install the package with pip, you will get an error at runtime)

import requests    print(requests.get("https://www.python.jp").text)


◆ Virtual environment Reference https://www.python.jp/install/windows/venv.html

  1. Create a project folder     C:\Users\user1>mkdir sample1

  2. Create virtual environment folder     C:\Users\user1\sample1>python -m venv .venv

--For command prompt 3. Virtual environment activate (cmd)     C:\Users\user1\sapmle1>.venv\Scripts\activate.bat     (.venv) C:\Users\user1\sample1>

  1. Install the package in the virtual environment with pip     (.venv) C:\Users\user1\sample1>python -m pip install requests

  2. Virtual environment deactivate     (.venv) C:\Users\user1\sample1> deactivate     C:\Users\user1\sample1>

--for powershell ・ Grant execution authority of powershell     PS C:> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

・ Virtual environment activate (ps)     PS C:\Users\user1\sapmle1> .venv\Scripts\activate.ps1     (.venv) C:\Users\user1\sample1>


◆ C compiler installation

  1. Select "Visual Studio 2019 Tools" (at the bottom of the downloads page)     https://visualstudio.microsoft.com/ja/downloads/

  2. Download "Build Tools for Visual Studio 2019"

  3. Launch the installer and select "C ++ Build Tools" to install


◆ Virtual environment operation method

  1. Output the package of your virtual environment to requirements.txt     (.venv) C:\Users\user1\sample1>python -m pip freeze > requirements.txt

  2. Refer to requirements.txt to install the package in the virtual environment     (.venv) C:\Users\user1\sample1>python -m pip install -r requirements.txt


◆ Separate virtual environments for each python version

・ 3.7 series     C:\Users\user1>py -3.7 -m venv py37env     C:\Users\user1>py37env\Scripts\activate.bat

・ 3.8 series     C:\Users\user1>py -3.8 -m venv py38env     C:\Users\user1>py38env\Scripts\activate.bat


◆ Version control tool ・ Git     https://git-scm.com/download/win

・ TortoiseGit & Language Packs     https://tortoisegit.org/download/

・ TortoiseGit reference video     https://youtu.be/5NEuiuqElio

Recommended Posts

python windows environment construction
Python environment construction (Windows10 + Emacs)
Python environment construction under Windows7 environment
Python environment construction
python windows environment
Environment construction (python)
python environment construction
Python --Environment construction
Python environment construction
python environment construction
Anaconda python environment construction on Windows 10
[Python3] Development environment construction << Windows edition >>
homebrew python environment construction
Python development environment construction
python2.7 development environment construction
Mac environment construction Python
Python environment construction @ Win7
Python project environment construction procedure (for windows)
VScode environment construction (Windows10, Python, C ++, C, Git)
Windows + gVim + Poetry python development environment construction
Python environment construction (Anaconda + VSCode) @ Windows10 [January 2020 version]
CI environment construction ~ Python edition ~
Python environment construction For Mac
Anaconda3 python environment construction procedure
Build Python environment on Windows
Python3 environment construction (for beginners)
Python environment construction and TensorFlow
Build python environment on windows
[MEMO] [Development environment construction] Python
[Tensorflow] Tensorflow environment construction on Windows 10
Environment construction of python2 & 3 (OSX)
Environment construction of python and opencv
Get started with Python! ~ ① Environment construction ~
Python + Unity Reinforcement learning environment construction
Install python2.7 on windows 32bit environment
I checked Mac Python environment construction
Python environment construction memo on Mac
Python environment construction (pyenv, anaconda, tensorflow)
Python development environment construction on macOS
Python environment construction (pyenv + poetry + pipx)
Ml-Agents Release 6 (0.19.0) Environment Construction Summary [Windows]
Environment construction of python3.8 on mac
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
Install Python development environment on Windows 10
Python3 TensorFlow for Mac environment construction
Emacs Python development environment construction memo
pytorch @ python3.8 environment construction with pipenv
[docker] python3.5 + numpy + matplotlib environment construction
Python3.6 environment construction (using Win environment Anaconda)
OpenCV3 & Python3 environment construction on Ubuntu
Django environment construction
OpenJTalk on Windows10 (Speak Japanese with Python from environment construction)
DeepIE3D environment construction
Emacs-based environment construction
Linux environment construction
Python on Windows
python environment settings
Python installation (Windows)
django environment construction
CodeIgniter environment construction
Python environment construction procedure memo using Docker on Windows10 Home