Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Python virtual environment: Virtualenv     - Java synchronization mechanism: synchronized, wait, notify (Programming)

- CentOS7 installation configuration (Server)

- iptraf: A Practical TCP / UDP network monitoring tools (Linux)

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

- How to manage start-up applications in Ubuntu (Linux)

- Oracle DataGuard principles and basic configuration (Database)

- ctop: monitor container performance Linux command line artifact (Linux)

- Ubuntu install the camera driver (Linux)

- iOS used in the development --UITabBarController tag controller (Programming)

- Unix average load average load calculation method (Server)

- gzip, bzip2, xz, tar, zip compression, archive Detailed (Linux)

- Nginx DHCP TFTP Kickstart set up automatic installation system (Server)

- ASM learning overview (Database)

- JavaScript common array manipulation functions and usage (Programming)

- When Vim create Python scripts, vim autocomplete interpreter and encoding method (Programming)

- The direct insertion sort algorithm (Programming)

- CentOS 7 Add yum source (Linux)

- 30 Practical Linux system administrators will learn the command (Linux)

- How to protect the Apache website under Linux system (Linux)

- Performance issues under CentOS 6.5 VLAN devices (Linux)

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

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

installation
sudo apt-get install python-virtualenv

Instructions
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
deactivate

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:
export PIP_REQUIRE_VIRTUALENV = true

Pip or let in the implementation of the system automatically turn on the virtual environment:
export PIP_RESPECT_VIRTUALENV = true

Virtualenvwrapper

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. ...

installation
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
workon

You can also use
lsvirtualenv

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
deactivate
     
         
       
         
  More:      
 
- Automate deployment of Docker-based Rails applications (Server)
- Gitblit adopted Ticket collaborative development model (Linux)
- How to compare PDF files on Ubuntu (Linux)
- Ubuntu 14.04 compile and install Apache (Server)
- Packages with Snort intrusion monitoring light (Linux)
- Install OpenGL development environment in Fedora and Ubuntu (Linux)
- Detailed Linux platform chip programming process (Programming)
- Linux create and delete user step (Linux)
- Java code JIT compiler-friendly Mody (Programming)
- Linux installation is larger than 2TB (UEFI interface) hard disk solution (Linux)
- DIY security of Linux platform (Linux)
- Linux three ways to set environment variables (Linux)
- Sublime Text 3 using summary (Linux)
- Introduces Linux kernel compilation system and compiler installation (Linux)
- Oracle RMAN repair logical bad blocks (Database)
- VMware installed Linux system and JDK deployment (Linux)
- Ubuntu deploying Solr (4.4) to Tomcat (7.0.53) (Server)
- CentOS 7.0 running Docker kernel error solution (Server)
- The Linux role of each directory contents (Linux)
- Try the command ip, ifconfig is obsolete under Linux (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.