It is easy to create a virtual environment with the function of Python.
As a merit of developing in a virtual environment
merit
・ You can create a clean environment for each project (easy to understand)
-You can use different Python packages and versions.
(It may solve the problem that can only be done with this version ...)
-Does not interfere with unnecessary libraries.
The impression I had when creating a virtual environment was that it was very simple and easy to understand. It's easy to create, so let's create it: relaxed:
Open a command prompt and go to the location you want to create in the current directory. Easy to execute the following code in the directory where you want to create it.
Create virtual environment
virtualenv
With this alone, you can create a virtual environment named "Kasokankyo".
If you want to specify the version of pyhton,
Create virtual environment (specify Python version)
virtualenv -p python3.7 Kasokankyo
You can also specify the version.
"Activate" when using a virtual environment. When you are done using it, "deactivate" it.
activation
C:\Kasokankyo>Scripts\\activate
Invalidation
C:\Kasokankyo>Scripts\\deactivate
As a rough flow, Create a virtual environment → Activate → Run a program or install a library → Disable at the end → Re-enable when doing something The flow.
When you no longer need it, delete the entire environment (folder of Kasokankyo).
Recommended Posts