virtualenv Basic command usage memo

Outline and purpose of this article

It is a basic command memo of virtualenv, a virtual environment creation tool in python.

Target person

What is virtualenv?

Install virtualenv

Like any other python package, you can install it with the pip command.

$ pip install virtualenv

Creating a virtual environment

Cd to the project you want to create a virtual environment and hit the following command to create the virtual environment. The virtual environment name can be any name. From now on, we will use a virtual environment named my_env.

#Virtual environment my for a specific project_Create env.
$ cd (The project you want to create a virtual environment)
$ virtualenv my_env

Enable virtual environment

The virtual environment is not valid just by creating it You need to enable it as follows:

#Enable the virtual environment myenv
$ source myenv/bin/activate

#If the following is displayed on the console, it is successful.!
(myenv) $ 

#The virtual environment is clean when it is just created.
#If you try pip freeze, you will see that only the minimum number of packages are installed.
(myenv) $ pip freeze
appdirs==1.4.3
packaging==16.8
pyparsing==2.2.0
six==1.10.0

Disable / delete virtual environment

Do the following for each.

#Disable virtual environment
(myenv) $ deactivate

#Delete virtual environment
# (You can delete the entire folder created directly under the project.)
$ rm -rf myenv/

Recommended Posts

virtualenv Basic command usage memo
Basic Python command memo
command memo
Command memo
Linux command (basic in basic) personal memo
Linux command <Basic 2>
scp command memo
who command memo
Flask basic memo
Linux # Command Memo 1
[Basic] linux command
Linux command <Basic 1>
RDKit usage memo
BESS Development Memo # 01: BESS Installation and Basic Usage
vi (vim) command memo
Basic usage of flask-classy
Basic usage of Jinja2
Linux basic command memorandum
Basic usage of SQLAlchemy
Python basic memo --Part 2
[Linux] Basic command summary
Python basic grammar memo
Python basic memo --Part 1
deap usage memo (OneMax)
Super basic usage of pytest
Basic usage of PySimple GUI
Convenient diff command usage notes
Python Basic Grammar Memo (Part 1)
Python basic grammar (miscellaneous) Memo (3)
Python basic grammar (miscellaneous) Memo (2)
Linux tar xz command memo
Basic usage of Pandas Summary
[Python] virtualenv creation procedure memo
Basic usage of Python f-string
Python basic grammar (miscellaneous) Memo (4)
[Learning memo] Django command summary
[Personal memo] Python virtual environment command memo
Easy usage memo of Anaconda (conda)
LINUX command [wc edition] Usage example
Linux command [ldconfig] LPIC learning memo
find / grep command (beginner's personal memo)