The basic commands for building an environment with python and conda are summarized.
pip --pip update
pip install -U pip
pip install --upgrade pip
--Package installation
pip install packageName
--Install by specifying the version
pip install 'packageName==1.1.2'
--Package update (-U
or —update
)
pip install -U packageName
--Uninstall package
pip uninstall -y packageName
--Check the package
pip list # list
pip pip list -o # show outdated
--Check the package version
pip freeze
--Export configuration file
pip freeze > requirements.txt # create package list
--Reading the configuration file
python -m pip install -r requirements.txt
conda --conda update
conda update conda
--Create virtual environment (specify python version)
conda create -n env-x python=3.5
--Create virtual environment (read yaml file)
conda env create -f env1.yaml
--Display the list of created virtual environments
conda info -e
--Switch to the created virtual environment
source activate env1
--Get out of the current virtual environment
source deactivate
--Delete virtual environment
conda env remove -n env1
conda remove —-all
--Export the current virtual environment configuration file
conda env export > env1.yaml
--Check the package of the current virtual environment
conda list
Recommended Posts