[Python] Create a virtual environment with Anaconda

How to create a virtual environment with Anaconda

Anything is fine for the time being, so Anaconda must be included.

Create a virtual environment

conda create -n Virtual environment name python = x.x List the packages to install (delimiter is space)

Example)

conda create -n py27 python=2.7 anaconda

You will be asked Proceed ([y] | n) ?, so press y

Checking the virtual environment

conda info -e

# conda environments:
#
chainer                  /home/user/anaconda2/envs/chainer
py27                     /home/user/anaconda2/envs/py27
py35                     /home/user/anaconda2/envs/py35
tensorflow               /home/user/anaconda2/envs/tensorflow
root                  *  /home/user/anaconda2

Delete virtual environment

conda remove -n py27 --all

conda info -e

# conda environments:
#
chainer                  /home/user/anaconda2/envs/chainer
py35                     /home/user/anaconda2/envs/py35
tensorflow               /home/user/anaconda2/envs/tensorflow
root                  *  /home/user/anaconda2

Make the virtual environment Active

user@MYPC:~$ source activate py27
discarding /home/user/anaconda2/bin from PATH
prepending /home/user/anaconda2/envs/py27/bin to PATH
(py27)user@MYPC:~$ conda info -e
# conda environments:
#
chainer                  /home/user/anaconda2/envs/chainer
py27                  *  /home/user/anaconda2/envs/py27
py35                     /home/user/anaconda2/envs/py35
tensorflow               /home/user/anaconda2/envs/tensorflow
root                     /home/user/anaconda2

For windows, use ʻactivate py27` to activate

Make the virtual environment inactive

(py27)user@MYPC:~$ source deactivate
discarding /home/user/anaconda2/envs/py27/bin from PATH
user@MYPC:~$ conda info -e
# conda environments:
#
chainer                  /home/user/anaconda2/envs/chainer
py27                     /home/user/anaconda2/envs/py27
py35                     /home/user/anaconda2/envs/py35
tensorflow               /home/user/anaconda2/envs/tensorflow
root                  *  /home/user/anaconda2

For windows, deactivate with deactivate

Details are written in the following document conda document

testing environment: OS: Ubuntu 14.04 LTE

Recommended Posts

[Python] Create a virtual environment with Anaconda
Create a virtual environment with Python!
Create a virtual environment with conda in Python
Building a virtual environment with Python 3
Create a virtual environment with Anaconda installed via Pyenv
Create a Python environment
Virtual environment with Python 3.6
Let's create a virtual environment for Python
Create a virtual environment with Python_Mac version
Build a python virtual environment with pyenv
Install Python environment with Anaconda
Building a Python environment with WLS2 + Anaconda + PyCharm
Create a python3 build environment with Sublime Text3
[Memo] Build a virtual environment with Pyenv + anaconda
Building a Python virtual environment
[Venv] Create a python virtual environment on Ubuntu
Work in a virtual environment with Python virtualenv.
Flow of creating a virtual environment with Anaconda
Create a directory with python
Building a Python virtual environment
From Python environment construction to virtual environment construction with anaconda
Create a Python virtual development environment on Windows
Steps to create a Python virtual environment with VS Code on Windows
Build a python virtual environment with virtualenv and virtualenvwrapper
Create a comfortable Python 3 (Anaconda) development environment on windows
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
Create a Japanese OCR environment with Anaconda (tesseract + pyocr)
Notes on creating a virtual environment with Anaconda Navigator
Build python virtual environment with virtualenv
Create a Python environment on Mac (2017/4)
Create a python environment on centos
When I tried to create a virtual environment with Python, it didn't work
Create a simple Python development environment with VSCode & Docker Desktop
Create a virtual environment for python on mac [Very easy]
[Pyenv] Building a python environment with ubuntu 16.04
[Python] Building an environment with Anaconda [Mac]
Change Python 64bit environment to 32bit environment with Anaconda
Building a Python3 environment with Amazon Linux2
Create a dummy image with Python + PIL.
Create a python environment on your Mac
Let's create a free group with Python
Building a Python 3.6 environment with Windows + PowerShell
[Python] Create a Batch environment using AWS-CDK
Create Python + uWSGI + Nginx environment with Docker
[Mac] Building a virtual environment for Python
Creating a python virtual environment on Windows
Build Python environment with Anaconda on Mac
Create a word frequency counter with Python 3.4
Creating a virtual environment in an Anaconda environment
Build a modern Python environment with Neovim
Add a Python virtual environment to VSCode
Create a Python execution environment for Windows with VScode + Remote WSL
Build a Python environment on your Mac with Anaconda and PyCharm
Try to create a python environment with Visual Studio Code & WSL
Create a C ++ and Python execution environment with WSL2 + Docker + VSCode
Create a simple Python development environment with VS Code and Docker
Create a USB boot Ubuntu with a Python environment for data analysis
python virtual environment Pipenv
Use Python 3.8 with Anaconda