Today here at Arzhost, we discuss how we create Python 2 Create Venv in our system management. For your Python program, Virtualenv is a helpful tool to establish an isolated environment. To keep it distinct from other Python applications, this environment has its own installation folders and environment.
Other environments do not share libraries with this. The simplest and most recommended method for setting up a unique Python environment is via Virtualenv. You can use the virtual environment you construct for your Python 2 program by following the instructions in this tutorial.
Python 2 Installation of Virtualenv
Python 2 Create Venv and PIP need to be set up on your system. Install the virtualenv Python package via pip2.
$ pip2 install virtualenv
Downloading https://files.pythonhosted.org/packages/f7/69/9a07/virtualenv-16.7.4-py2.py3-none-any.whl (3.3MB)
100% |████████████████████████████████| 3.3MB 448kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-16.7.4
Establish a virtual environment
The normal location is where Python3 is installed. Using the which command, locate the Python 2 Create Venv binary file location.
Create a unique atmosphere for your application right away. The environment directory name (isoEnv in the example below) can be change to suit your preferences. The environment directory may also be define in a different place.
$virtualenv -p /usr/bin/python2 isoEnv
Running virtualenv with interpreter /usr/bin/python2
Already using interpreter /usr/bin/python2
Using base prefix '/usr'
New python executable in /var/webapps/isoEnv/bin/python2
Also creating executable in /var/webapps/isoEnv/bin/python
Installing setup tools, pip, wheel...
With this command, a local copy of your environment unique to this website is create. To ensure that you are using the correct versions of your tools and packages when working on this website. You should enable the local environment.
Establish a virtual environment Cont…
Run the following commands to activate the new virtual environment:
isoEnv/bin/activate as a source
To the left of the question, Python 2 Create Venv the name of the active virtual environment is display. For example:
Run the following commands to make sure Python is the right version:
Python -V (isoEnv) root@tecadmin
7.12 of Python
Any package that you install using pip is now store separately from the overall Create Venv installation in the virtual environments project folder.
Pip2 can be used to install modules:
root@tecadmin$ pip2 install module> (isoEnv)
If you’re planning to work with OpenStack, you can utilize “nose”. For instance:
(is Env) root@tecadmin$ pip2 install nose
|████████████████████████████████| 163kB 18.6MB/s
Installing collected packages: nose
Successfully installed nose-1.3.7