[PYTHON] conda command cheat sheet

Overview

I want to manage Python packages and more! I want to create a virtual environment with conda! I want to reproduce the created environment on a new PC!

For those who say, and as a memorandum of my own, I have summarized the commands of conda. There are various other commands, but I'm collecting only those that are likely to be used.

I haven't explained the commands in detail, so what is conda delicious? If so, you may want to look for a tutorial-like article once. I would be happy if you could use it for cheat sheet purposes.

Also, as a flow to use conda

--List display -(Create virtual environment) --Enter the environment --Package management -(Output a list for environment reproduction) --Get out of the environment -(Delete environment)

I think it will be a flow like that, so I wrote it with that flow in mind.

conda command

List of conda environments

conda info -e

Package list display

--Display the package list of the current conda environment

conda list

--Display the package list of the specified conda environment

conda list -n py38

Create virtual environment

--Created by specifying the python version

conda create --name py38 python=3.8
conda create -n py38 python=3.8

--Copy and create virtual environment

Example: Copy base to make py38

conda create -n py38 --clone base

--Rebuild the environment from the list for environment reproduction

conda create -n py38 --file package-list.txt

conda environment activation

conda activate py38

Search for packages

conda search tensorflow

Package installation

--Installation

conda install tensorflow

--Install by specifying the version

conda install tensorflow=1.15

Package update

--Updating the package

conda update tensorflow

--All packages are up to date

conda update --all

Delete package

conda remove tensorflow

Output list for environment reproduction

conda list --export > package-list.txt

Exit of conda environment

conda deactivate

Delete virtual environment

conda remove -n py38 --all

reference

https://qiita.com/yasushi-jp/items/7ce0975db7a7e9ac7991 https://qiita.com/WestRiver/items/cce9c99076d59abd3f69

Recommended Posts

conda command cheat sheet
Linux command cheat sheet
ps command cheat sheet
Curry cheat sheet
Memorandum conda command
SQLite3 cheat sheet
pyenv cheat sheet
PIL / Pillow cheat sheet
Spark API cheat sheet
Python3 cheat sheet (basic)
PySpark Cheat Sheet [Python]
Python sort cheat sheet
Go language cheat sheet
tox configuration file cheat sheet
numpy memory reuse cheat sheet
[Python3] Standard input [Cheat sheet]
Data Science Cheat Sheet (Python)
Slack API attachments cheat sheet
Python Django Tutorial Cheat Sheet
scikit learn algorithm cheat sheet
Apache Beam Cheat Sheet [Python]
Google Test / Mock personal cheat sheet
Continuation Passing Style (CPS) Cheat Sheet
Python cheat sheet (for C ++ experienced)
Python Computation Library Cheat Sheet ~ itertools ~
Curry cheat sheet [Description example list version]
AtCoder cheat sheet in python (for myself)
Blender Python Mesh Data Access Cheat Sheet
Mathematical Optimization Modeler (PuLP) Cheat Sheet (Python)
A brief description of pandas (Cheat Sheet)