1. Install the Python environment:
This is not to be discussed here.
2, install VIRTUALENV virtual environment:
This is used to create a virtual environment using the third-party tool Virtualenv . The benefits of the virtual environment are as follows (excerpt network):
" install flask The most convenient way is to use a virtual environment. The virtual environment is a private copy of the python interpreter, in In this environment you can install private packages , and does not affect the global python interpreter installed in the system. "
"< Span class= "Fontstyle2" > Virtual environment is very useful, can be in the system python The interpreter avoids the confusion of the package and the version conflict. Creating a separate virtual environment for each neat, Make it a source for creating (more) virtual environments. The advantage of using a virtual environment is that you do not need Administrator privileges. "
Enter command in CMD: virtualenv--version to detect if the Windows system has Virtualenv installed, error description not installed, Install virtualenv with the command pip install.
Install and then enter the command: Virtualenv--version, such as:
Create a project directory that you can either receive or create with the following command:
A venv folder is generated under the Pythonproject folder on the G-disk.
To activate a virtual environment:
Enter Command venv\scripts\activate
3. Install flask in virtual environment:
Use the command pip install flask
Start the Python interpreter, import Flask, and verify that it is installed:
If there is no error, the installation is successful.
4. Open the project with Pycharm:
Select "File", "Open", such as:
can be easily developed.
As a beginner, I create projects like this, and how to create them in real work is unclear.
Install flask under Windows