当前位置:网站首页>install flask

install flask

2022-08-09 06:27:00 Koala Rice Bowl

If the python environment is not installed, please click this link to downloadhttps://www.python.org/downloads/release/python-392/

Flask installation conditions

Installing Flask usually requires Python 2.6 or above.While Flask and its dependencies work with Python 3 and above, many Flask extensions do not properly support it.So, it is recommended to install Flask on Python 2.7.

Install virtualenv for development

virtualenv is a virtual Python environment builder.It helps users to create multiple Python environments in parallel.Therefore, it avoids compatibility issues between different versions of the library.To put it bluntly, the virtual environment can be installed without interfering with other python environments.
1. Install virtualenv using the following command in a command window:

pip install virtualenv #windows use this statementsudo apt-get install virtualenv #Linux/Mac OS use this

2. Create a new virtual environment in the folder after the installation is complete

mkdir newvenv #create filecd newvenv #Enter filevirtualenv venv #Create an environment (Venv is the name of your virtual environment and can be changed)

3. Activate the corresponding environment:

windos Enter into the venv\scripts\ directory and enter activate to activate the environmentvenv\scripts\activate#This is windowsvenv/bin/activate #This is Linux/OS X

If there are brackets with your environment in front of your command line, it means that you have activated successfully
Since it can be activated, you can also exit
Enter the environment directory like the previous operation

**cd Scripts #Enter the virtual environment scripts directorydeactivate #exit environment

If the preceding brackets disappear, it means that the current environment has been exited

4. Install Flask in the prepared virtual environment:

pip install Flask #windows use this statementsudo apt-get install Flask#Linux/Mac OS use this

Successfully installed insert image description here

原网站

版权声明
本文为[Koala Rice Bowl]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208090622259727.html