Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Python virtual environment: Virtualenv     - OpenSSH server configuration file for each Common Definition (Server)

- Camouflage Nginx Web server version to prevent invasion (Linux)

- Quota for Vsftpd do use disk quotas (Server)

- Using Java arrays implement sequential stack (Programming)

- ElasticSearch basic usage and cluster structures (Server)

- Linux find command usage summary (Linux)

- To install HDRMerge 0.4.3 under ubuntu (Linux)

- MySQL migration tool used in the production environment (Database)

- How to install PlayOnLinux 4.2.5 under Ubuntu 14.04 / 12.04 (Linux)

- JDK installation notes under CentOS (Linux)

- [JavaScript] catch (ex) statements of ex (Programming)

- Linux --- process handle limit summary (Linux)

- C ++ Supplements - References (Lvalue Reference, Rvalue Reference) (Linux)

- Compare Swift achieve rapid sorting and sorted Methods (Programming)

- Linux, Eclipse flash back and reinstall the JDK methods (Linux)

- Python script running in the background (Programming)

- C # function (Programming)

- Realization of Linux operating system illegal IP censorship (Linux)

- C ++ Fundamentals study notes (Programming)

- Repair Raspbian Encountered a section with no Package (Linux)

  Python virtual environment: Virtualenv
  Add Date : 2016-07-11      

virtualenv environment for creating standalone Python, Python plurality of mutually independent of each other, it can:
1. Install the new kit in the case without permission
2. The different applications can use different versions of packages
3. Upgrade kit does not affect other applications

sudo apt-get install python-virtualenv

virtualenv [virtual environment name]

For example, to create a virtual environment ** ENV **
virtualenv ENV

By default, the virtual environment will depend on the system environment site packages, that is to say the system has been installed third-party package will be installed in the virtual environment, if you do not want to rely on these package, you can add parameters --no-site -packages create a virtual environment
virtualenv --no-site-packages [name of the virtual environment]

Start Virtual Environment
cd ENV
source ./bin/activate

Note that this time will be more than a command line (ENV), ENV virtual environment name, then all modules will only be installed into that directory.

Exit Virtual Environment

Python installation kit in a virtual environment

Virtualenv pip comes with installation tools, so you need to install the kit can be run directly:
pip install [package name]

If you do not start the virtual environment, the system also installed pip tool, the kit will be installed in the system environment, in order to avoid this, you can add in ~ / .bashrc file:

Pip or let in the implementation of the system automatically turn on the virtual environment:


Virtaulenvwrapper virtualenv is an expansion pack for easier management of the virtual environment, it can be done:
1. Place all in a virtual environment integration directory
2. management (add, delete, copy) Virtual Environment
3. Switch Virtual Environment
4. ...

sudo easy_install virtualenvwrapper

In this case you can not use virtualenvwrapper, virtualenvwrapper default installed in / usr / local / bin Now, you actually need to run the file virtualenvwrapper.sh job, do not worry, open the file and see, there are installation procedures, we operate according to the environment is set up.

1. Create a directory to store the virtual environment
mkdir $ HOME / .virtualenvs

2. ~ / .bashrc add line: export WORKON_HOME = $ HOME / .virtualenvs

3. ~ / .bashrc to add a row: source /usr/local/bin/virtualenvwrapper.sh

4. Run: source ~ / .bashrc

At this point you can use virtualenvwrapper.

Lists the virtual environment list

You can also use

New Virtual Environment
mkvirtualenv [virtual environment name]

Start / switch the virtual environment
workon [virtual environment name]

Delete Virtual Environment
rmvirtualenv [virtual environment name]

Leave the virtual environment
- RHEL (RedHat) 6.3 using EPEL Yum source (Linux)
- Vmstat command Linux Performance Monitoring (Linux)
- MongoDB polymerization being given (Database)
- Android child thread really do not update UI (Programming)
- Use rfkill soft-switching and Bluetooth wireless capabilities in Linux (Linux)
- Oracle 11G R2 DataGuard structures (Database)
- Network Security: SYN attacks against under linux (Linux)
- Windows 8.1 and Ubuntu 14.04 dual system uninstall Ubuntu Tutorial (Linux)
- Linux file permissions to modify the command: chmod (Linux)
- Linux firewall rules example Extracts (Linux)
- Linux Samba server-side structures and the use of the client (Server)
- Ubuntu under shadowsocks configuration instructions (Linux)
- CentOS How quickly customize kernel binary RPM package (Linux)
- Apache Web Security Linux systems (Linux)
- Several Methods of SSH Auto - login (Linux)
- Construction Spark source and application development environment (Server)
- MySQL import large amounts of data (Database)
- C language binary tree (Programming)
- Installation Enpass secure password manager on Ubuntu (Linux)
- Laravel 4.2 Laravel5 comprehensive upgrade Raiders (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.