[PYTHON] Create a virtual environment with Anaconda installed via Pyenv

reference

Official documentation

Setting up a virtual environment

Create a virtual environment

conda create -n hoge anaconda

Check the created environment

conda info -e

Switch to the created environment

source activate hoge

Return from the created environment

source deactivate

You should get the following error

Error: activate must be sourced. Run 'source activate envname'
instead of 'activate envname'.

Usage: source activate ENV

adds the 'bin' directory of the environment ENV to the front of PATH.
ENV may either refer to just the name of the environment, or the full
prefix path

Because the activate command of pyenv has been executed Enter the full path so that the conda command can be executed, or register it in alias.

# .Added to zshrc
# for anaconda activate/deacitvate cmd
alias activate="source $HOME/.pyenv/versions/anaconda3-2.5.0/bin/activate"
alias deactivate="source $HOME/.pyenv/versions/anaconda3-2.5.0/bin/deactivate"

Delete the created environment

conda remove --name hoge --all

Recommended Posts

Create a virtual environment with Anaconda installed via Pyenv
[Python] Create a virtual environment with Anaconda
[Memo] Build a virtual environment with Pyenv + anaconda
Create a virtual environment with Python!
Create a virtual environment with Python_Mac version
Build a python virtual environment with pyenv
Create a virtual environment with conda in Python
Build a virtual environment with pyenv and venv
Flow of creating a virtual environment with Anaconda
code-server Online environment (2) Create a virtual network with Boto3
Create a Japanese OCR environment with Anaconda (tesseract + pyocr)
Notes on creating a virtual environment with Anaconda Navigator
Building a virtual environment with Python 3
[Pyenv] Building a python environment with ubuntu 16.04
Let's create a virtual environment for Python
Creating a virtual environment in an Anaconda environment
How about creating a virtual environment with Anaconda and doing pip install?
Unable to import packages installed in virtual environment with Anaconda on Windows 10
Steps to create a Python virtual environment with VS Code on Windows
Create a Python3 environment with pyenv on Mac and display a NetworkX graph
How to create a Python virtual environment (venv)
Building an Anaconda environment for Python with pyenv
Building a Python environment with WLS2 + Anaconda + PyCharm
Start Django in a virtual environment with Pipenv
Create a python3 build environment with Sublime Text3
Build a simple Python virtual environment without pyenv
[Venv] Create a python virtual environment on Ubuntu
Work in a virtual environment with Python virtualenv.
From Python environment construction to virtual environment construction with anaconda
Create a Python virtual development environment on Windows
Use anaconda virtual environment with Zsh (problem fix)
Create a Python environment
Virtual environment with Python 3.6
Creating an environment for OSS-DB Silver # 1_Create a Linux environment (CentOS7 virtual environment) with VirtualBox/Vagrant
When I tried to create a virtual environment with Python, it didn't work
A memo to create a virtual environment (venv) before Django
Building a Python environment for pyenv, pyenv-virtualenv, Anaconda (Miniconda)
Build a python virtual environment with virtualenv and virtualenvwrapper
Use Python installed with pyenv for PL / Python execution environment
Create a comfortable Python 3 (Anaconda) development environment on windows
Create a python development environment with vagrant + ansible + fabric
Build a python virtual environment with virtualenv and virtualenvwrapper
Create a django environment with docker-compose (MariaDB + Nginx + uWSGI)
Build a Django environment for Win10 (with virtual space)
Create a machine learning environment from scratch with Winsows 10
Build a numerical calculation environment with pyenv and miniconda3
Use Anaconda in pyenv environment
Install Python environment with Anaconda
Create a homepage with django
Building a Python virtual environment
Create a heatmap with pyqtgraph
[Anaconda] Activate the virtual environment
Create a directory with python
Switch virtual environment with jupyter
Building a Python virtual environment
Create a Python (pyenv / virtualenv) development environment on Mac (Homebrew)
Create a GO development environment with [Mac OS Big Sur]
I want to use a virtual environment with jupyter notebook!
Get a clean Python development environment with pyenv + pipx + Poetry
Create a simple Python development environment with VSCode & Docker Desktop
I just built a virtual environment with AWS lambda layer