virtualenv Used to manage python Project environment , Isolate a virtual... That only belongs to this project python Environmental Science (windows and Linux Use the same ).

First you need to install virtualenv modular

pip isntall virtualenv

Create a virtual environment for an engineering project

cd D:\project
virtualenv project_env

If the new python The virtual environment also needs the original python Third party library , Use the following command , Third party libraries can be copied together to a new virtual environment

virtualenv --system-site-packages project_env

If there are more than one python edition , such as python2.7、python3.7 etc. , You need to specify different versions of python Interpreter . Is not specified , It is usually set by default python Version to build

virtualenv -p "D:\Program Files\Python37\python.exe" project_env2 Linux
virtualenv -p /usr/bin/python3. project_env

Activate the virtual environment

cd D:\project\project_env\Scripts
activate.bat #Linux
source project_env/bin/activate

Shut down the virtual environment

deactivate.bat #Linux


virtualenvwrapper It's encapsulated virtualenv Some characteristics of , More simple and convenient python Environmental management tools . and virtualenv The main difference is that it can manage multiple virtual environments in batches .

install virtualenvwrapper Before , Make sure you have installed virtualenv,windows Installation required in environment virtualenvwrapper-win

pip install virtualenvwrapper-win

Create the first virtual environment

mkvirtualenv project1

Create a second virtual environment

mkvirtualenv project2

List all virtual environments


Switch virtual environment

workon project

Stop the virtual environment


Open virtual environment , Need to switch to the virtual environment script Folder


Delete virtual environment



Linux The platform needs to be installed virtualenvwrapper modular

yum install virtualenvwrapper

Start with command virtualenvwrapper

source /usr/local/bin/

The command is used in the same way , Indistinguishes windows and Linux.

python One of the three artifact virtualenv More articles about

  1. python One of the three artifact virtualenv pip, virtualenv, fabric Commonly known as pythoner The three artifact of .

    python One of the three artifact virtualenv   pip, virtualenv, fabric Commonly known as pythoner The three artifact of . virtualenv virtualenv------ To create a virtual ...

  2. python One of the three artifact pip

    pip It's a management python Tools for all kinds of packages and Libraries , Very easy to use . Here are some common commands . ● install :pip install Library name You can also specify a version :pip install Library name = edition ● uninstall :pip unin ...

  3. python One of the three artifact fabric

    Fabric Fabric It's a python Remote execution of shell The library of , It's also a command line tool . It provides a wealth of sameness SSH Interface of interaction , Can be used to automate on local or remote machines . To carry out in a streamlined way Shell command . ...

  4. python One of the three artifact fabric(2.0 New characteristics )

    fabric It often appears in the field of automatic operation and maintenance , Batch processing of some operation and maintenance work .fabric Is in paramiko There's another layer on it , It's easier to operate . I just wanted to write a blog , Then I found that the code I had written could not run , Report below ...

  5. I don't know how to tell the goddess ?Python Three magic skills take you to successfully counter attack every minute !

    a line python The confession of First of all, sacrifice the unique skill , use 1 That's ok python Confession : print(' '.join([''.join([('I LOVE U'[(x-y) % 8] if ( (x*0.05)**2 + ( ...

  6. shell One of the three artifact of programming awk

  7. shell One of the three artifact of programming grep

  8. Python The generator of the three

    Python The generator of the three I'm new to generator What is a generator The generator itself is an iterator . Inherits the properties of iterators , Lazy evaluation , It takes up very little memory space . Why have a generator We want to use the inert evaluation of iterators to create a system that can hold millions of ...

  9. Python The iterator of the three

    Python The iterator of the three iterator protocol The iterator protocol states : Object must provide a __next__ Method , Executing the method on it either returns the next item in the iterator ( For the time being, it can be understood as the next element ), Or cause a Stopiterat ...

Random recommendation

  1. adopt 3 individual Hello World Application to understand ASP.NET 5 How applications work (1)

    Microsoft is developing ASP.NET 5( It was called ASP.NET vNext) It's coded as Project K, So the runtime is called KRuntime.KRuntime It's a SDK, It contains all the resources to compile and run the application ...

  2. Talking about SQLiteOpenHelper And onUpgrade Example

    When you see this blog post , First you need to understand onCreate This creation method , Let's move on !( Please refer to my last blog ...

  3. Study C Language commonly used several websites

    I'll sort out the information today , I found that I used to learn C Language , Common to a few websites : 1.    The website contains C Language standard version of 15 Header file explanation and functions ,137 A function and demonstration ...

  4. iOS Local data storage ( Reprint )

    See a good article , I recommend it to you !!! Use sandbox 1) Every iOS Every app has its own sandbox ( The application sandbox is the file system directory ), Isolated from other file systems . Apps have to stay in their sandbox , Other applications cannot access the sandbox 2) Apply sandbox text ...

  5. C# How to judge whether the data is NaN

    double a = 0 / 0d; if (double.IsNaN(a)){ //do } In floating point calculation , 0 Divide 0 Will get NaN , A positive number divided by 0 Will get PositiveInfinity , Negative divided by 0 ...

  6. 【 Joseph's ring is deformed 】UVa 1394 - And Then There Was One

    First of all, when I saw this question, I immediately jumped out of my mind .. Later, I continued to read the analysis of Rujia , The time complexity of the linked list method is O(n*k), Definitely TLE, Only then did I realize that I had a simple mind T^T. I don't understand the home analysis , Later, I found that this article is easier to understand ...

  7. ORACLE journal logminer Use

    1. logminer install SQL> @$ORACLE_HOME/rdbms/admin/dbmslm.sql Package created. Grant succeeded. Synonym ...

  8. OpenGL Draw a pyramid , To eliminate

    /** * Buffer tool class  */public class BufferUtil { /**  * Convert floating point array to byte buffer   */ public static ByteBuffer arr2ByteB ...

  9. mongodb3.0 Fragmentation and java Code connection operation test ( Turn on user authentication )

    Recently I took time to build mongodb Simple slicing , The whole process is quite smooth , It's just that there are some problems with user authentication , Fortunately, it's finally done . One . Server build process : 1. Install four mongodb: As a config. One ...

  10. pydemo_testMaopuSpider

    import json from multiprocessing import Pool import requests from requests.exceptions import Request ...