[PYTHON] Use anaconda virtual environment with Zsh (problem fix)

Overview

Use anaconda's Jupyter Notebook installed with pyenv with zsh (problem fix), and summarize the trial and error for using Jupyter Notebook with Zsh as a memorandum. Keep it.

Defect status

--Even though you can check the virtual environment with $ conda info -e, you cannot activate it with$ conda activate <virtual environment name>.

environment

Mac OS Mojave

Method

1. Try running the virtual environment

Terminal


$ conda activate <Virtual environment name>

The error message returned

Terminal


CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

2. Initialize

Terminal


$ conda init <SHELL_NAME>* This time, "zsh"

3. Reboot the shell

Terminal


$ exec $SHELL -l

Digression. Response after restarting the shell

When I restarted the shell, the prompt was (base) <username>%. It seems that it has entered the base environment of Python, so exit the virtual environment with $ conda deactivate.

The site that I used as a reference

-Python memo-50 (I can't activate on fish shell after conda 4.4.6) (conda, activate, fish)

Recommended Posts

Use anaconda virtual environment with Zsh (problem fix)
[Python] Create a virtual environment with Anaconda
Use Python 3.8 with Anaconda
[Memo] Build a virtual environment with Pyenv + anaconda
Flow of creating a virtual environment with Anaconda
Use Python in Anaconda environment with VS Code
From Python environment construction to virtual environment construction with anaconda
Create a virtual environment with Anaconda installed via Pyenv
Notes on creating a virtual environment with Anaconda Navigator
Use Anaconda in pyenv environment
Install Python environment with Anaconda
Build an Anaconda virtual environment
[Anaconda] Activate the virtual environment
I want to use a virtual environment with jupyter notebook!
Activate Anaconda's virtual environment with PowerShell
Build python virtual environment with virtualenv
Create a virtual environment with Python!
Building a virtual environment with Python 3
Use Tensorflow 2.1.0 with Anaconda on Windows 10!
PATH when using ANACONDA virtual environment with Pycharm (as of Mac 2020/10/03)
[Python] Building an environment with Anaconda [Mac]
Change Python 64bit environment to 32bit environment with Anaconda
Vue.js + Flask environment construction memorandum ~ with Anaconda3 ~
[5 steps] Apply anaconda virtual environment to VScode
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
Create a virtual environment with Python_Mac version
Automatically switch virtual environment with conda + direnv
Build Python environment with Anaconda on Mac
Build a python virtual environment with pyenv
Creating a virtual environment in an Anaconda environment
Call anaconda virtual environment from ubuntu terminal memorandum
MacOS 10.11 environment construction: Powerline with Anaconda and Dein.vim
Building an Anaconda environment for Python with pyenv
Start Django in a virtual environment with Pipenv
Python (Windows 10) Virtual Environment / Package with VS Code
Create a virtual environment with conda in Python
Use multiple versions of python environment with pyenv
Try using conda virtual environment with Jupyter Notebook
[0] TensorFlow-GPU environment construction built with Anaconda on Ubuntu
Error when entering virtual environment with workon command
Build a virtual environment with pyenv and venv
[Node-RED] Execute Python on Anaconda virtual environment from Node-RED [Anaconda] [Python]
Work in a virtual environment with Python virtualenv.
Use jupyter-lab installed in python virtual environment (venv)
Error running Jupyter Notebook in Anaconda virtual environment
Beginner virtual environment
Virtual environment construction with Docker + Flask (Python) + Jupyter notebook
Build a python virtual environment with virtualenv and virtualenvwrapper
Create an Anaconda virtual environment in your project folder
Use Python installed with pyenv for PL / Python execution environment
code-server Online environment (2) Create a virtual network with Boto3
Build a python virtual environment with virtualenv and virtualenvwrapper
Python development environment with Windows + Anaconda3 + Visual Studio Code
Double-click to open ipynb file (Mac, Anaconda virtual environment)
Command line collection for using virtual environment in Anaconda
Create a Japanese OCR environment with Anaconda (tesseract + pyocr)
Ssh to virtual environment with remote development of vscode
Build a Django environment for Win10 (with virtual space)
Building an environment to use CaboCha with google colaboratory
How to build Anaconda virtual environment used in Azure Machine Learning and link with Jupyter