Create a virtual environment with conda in Python

Introduction

I stumbled upon using a virtual environment in Python, so I'll leave it as a note. Also, I would like to summarize the points that I did not understand well when using the virtual environment with vscode.

conda create a virtual environment

To create a virtual environment, execute the code as follows.

$ conda create -n (Virtual environment name) python (Library name)

The virtual environment name can be any name you like. In the next python part you can also specify the version like python = 3.7. If you enter the desired library name in the library name part, it will be installed when you create the virtual environment.

By doing this, I think that anaconda3 / envs / virtual environment name / python.exe will be added, so when switching the virtual environment with vscode, you should specify this exe file.

Also,

$ conda create -n env python anaconda

Then, anaconda will be installed when you create the virtual environment env.

Switch virtual environment

Enabling the virtual environment

$ conda activate (Virtual environment name)

Disabling the virtual environment

$ conda deactivate (Virtual environment name)

You can do it with. You can also get a list of conda virtual environments by doing the following:

$ conda info -e

Delete the virtual environment

You can delete the virtual environment with the following command.

$ conda remove -n (Virtual environment name) --all

Install the library

You can install the library with the following command.

$ conda install (Library name)

Recommended Posts

Create a virtual environment with conda in Python
Create a virtual environment with Python!
[Python] Create a virtual environment with Anaconda
Work in a virtual environment with Python virtualenv.
Building a virtual environment with Python 3
Let's create a virtual environment for Python
Create a virtual environment with Python_Mac version
virtual environment in python
Create a Python environment
Build a python virtual environment with pyenv
Virtual environment with Python 3.6
How to create a Python virtual environment (venv)
Start Django in a virtual environment with Pipenv
Create a python3 build environment with Sublime Text3
[Venv] Create a python virtual environment on Ubuntu
Create a new page in confluence with Python
[Docker] Create a jupyterLab (python) environment in 3 minutes!
Create a Python virtual development environment on Windows
Create a function in Python
Create a dictionary in Python
Building a Python virtual environment
Create a directory with python
Building a Python virtual environment
Steps to create a Python virtual environment with VS Code on Windows
Recommendation of building a portable Python environment with conda
Build a python virtual environment with virtualenv and virtualenvwrapper
Create a virtual environment with Anaconda installed via Pyenv
Create a python development environment with vagrant + ansible + fabric
code-server Online environment (2) Create a virtual network with Boto3
Build a python virtual environment with virtualenv and virtualenvwrapper
conda memorandum: Building a Python environment with supercomputer ITO
Create a fake Minecraft server in Python with Quarry
Build python virtual environment with virtualenv
Create a DI Container in Python
Create a Python environment on Mac (2017/4)
When I tried to create a virtual environment with Python, it didn't work
Create a binary file in Python
Create a Django project and application in a Python virtual environment and start the server
Create a python environment on centos
Create a Kubernetes Operator in Python
Create a random string in Python
Try running python in a Django environment created with pipenv
Create a list in Python with all followers on twitter
[Django3] Display a web page in Django3 + WSL + Python virtual environment
Create a child account for connect with Stripe in Python
Let's create a script that registers with Ideone.com in Python.
How to develop in a virtual environment of Python [Memo]
Create a simple Python development environment with VSCode & Docker Desktop
Create a virtual environment for python on mac [Very easy]
Create an exe file that works in a Windows environment without Python with PyInstaller
[Pyenv] Building a python environment with ubuntu 16.04
Spiral book in Python! Python with a spiral book! (Chapter 14 ~)
Create a Python function decorator with Class
Building a Python3 environment with Amazon Linux2
Build a blockchain with Python ① Create a class
Create a dummy image with Python + PIL.
Create a python environment on your Mac
Create a simple GUI app in Python
Let's create a free group with Python
Create a JSON object mapper in Python
Building a Python 3.6 environment with Windows + PowerShell