Company use windows The server , To put python The program is deployed on the server
First configuration python Environmental Science Download from the official website python Installation package :
python download
I chose 3.5.4 Of 64 Bit offline installation package , Download according to the system bits
Put the installation package on the server , Click on the right “ Run as administrator ”, If you do not run as an administrator, the system may prevent you from installing .
Remember to check Add Python 3.5 to PATH Omit the disgusting step of configuring environment variables .
Wait for the installation , open cmd, Input python
Successful installation python 3.5.4 The appearance of .
python It is recommended to install virtual environment .
Type... In the command window pip install virtualenvwrapper-win
Install virtual environment management
installation is complete
Next, create a virtual environment :
mkvirtualenv Virtual environment name
Enter the virtual environment just created , Activate it :
cd Envs
function
workon Virtual environment name
Then you can do whatever you want in this virtual environment python The program installation package environment .
Finally, the setting for people with OCD : Customize the path of the virtual environment :
1 First add environment variables :
Computer – attribute - Advanced system setup – environment variable – newly build
Create a new system environment variable VIRTUALENV_HOME
The value is the path you want to store , I'm going to set it to zero E:\Virtualenv
2 open python The installation path , find Script
Folder , edit mkvitualenv.bat
file :
Modify the following code :
Change the path defining the installation to the environment variable just set :
You can annotate the original as I did , Rewrite a line by yourself :set "venvwrapper.default_workon_home=%VIRTUALENV_HOME%"
preservation , restart cmd window .
Carry out orders mkvirtualenv Virtual environment name
The virtual environment will be created in the customized directory .
Activate the virtual environment :
cd To the virtual environment folder , find Script Folder , perform activate.bat
Exit virtual environment :
perform deactivete
This is about windows server 2008 r2 Standard version installation python This is where the article on environment is introduced , More about win2008 r2 install python Please search the previous articles of software development network or continue to browse the relevant articles below. I hope you will support software development network more in the future !