win10 + python + vscode configure the development environment 01

A, win10 installation virutalenv

Open cmd
Why not powershell? Since then activate powershell start the virtual environment when an error, and the command window is activated, this is a big bug.

pip install virtualenv
pip install virtualenvwrapper

1, to create a virtual environment

Select a file to store the virtual environment, such as D: \ Python

cd D:python3  # 进入该文件
virtualenv envname   # 创建一个名字为envname的虚拟环境
dir     # 查看当前目录可以知道一个envname的文件已经被创建

virtualenv -p python2 envname  # 如果安装了多个python版本,如py2和py3,需要指定使用哪个创建虚拟环境

note:

If the command is not recognized virtualenv, may not be added to the python installation path or system environment variables virtualenv not installed or not re-open a window cmd;

2, start the virtual environment

# 进入虚拟环境文件
cd envname
# 进入相关的启动文件夹
cd Scripts

activate  # 启动虚拟环境
deactivate # 退出虚拟环境

3, installation mysql5.7

Installation Tutorial MySQL5.7

How Win10 hide file extensions? Methods Win10 system removes the file name suffix

python3.6+django

Enter the virtual environment
1, install django

pip install django==2.0.6

2. Create a django project

django-admin startproject django01

3, start the service

manage.py runserver

4, create app

manage.py startapp MyApp

vscode configure the development environment

1, the installation vscode

Installation vscode

2, the configuration vscode + python development environment

Open VSCode
Click on the box
. 1, mounted python plug
Here Insert Picture Description2 mounted Chinese extended package
Chinese expansion pack installed
3, the setup icon to directory Attractive
Install icon
4, is provided
Set up
Click on the small pencil
a path to a virtual environment provided python path
Set the path to python path of the virtual environment
virtual environment python directory configuration
Python virtual environment configuration directory
virtual path configuration environment
Virtual path configuration environment
VSCode variables
vscode brighten

Published 14 original articles · won praise 1 · views 1187

Guess you like

Origin blog.csdn.net/weixin_45541391/article/details/104099107