M1 Miniconda 설치 및 가상 환경 설정

ImOk·2022년 3월 9일
0

ML

목록 보기
1/2
post-thumbnail

M1 Miniconda 설치 및 가상 환경 설정

1. miniconda 설치 및 환경 설정

1.1 brew로 miniconda 설치

$brew search miniconda
$brew install miniconda

1.2 환경변수 설정

$vi ~/.zshrc
export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH"
$source ~/.zshrcs

# python 경로 확인 /opt/homebrew/Caskroom/miniconda/base/bin/python
$which python

# iterm 종료 및 재실행 후 실행
$conda init zsh
$source ~/.zshrcs

2. conda 가상 환경 설정

2.1 가상 환경 만들기

# 가상환경 python=3.6 create 불가 
$conda create -n env01 python=3.6
# 성공
$conda create -n env01 python=3.8

2.1.1 conda create issue

  • Python 3.6, 3.7 builds for osx-arm64 were never part of the regular build matrix for Conda Forge
$conda create -n env01 python=3.6
  • error
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - python=3.6

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

2.2 가상 환경 리스트 확인

$conda env list

2.3 가상 환경 실행

$conda activate env01

2.4 kernel 생성

  • Installed kernelspec env01 in /Users/imok/Library/Jupyter/kernels/env01
# ipykernel 설치
$conda install -c conda-forge -y ipykernel
#conda install -c conda-forge -y --prefix /opt/homebrew/Caskroom/miniconda/base/envs/imok ipykernel
$python -m ipykernel install --user --name env01 --display-name 'env01'

2.5 jupyterlab 설치 및 실행

$conda install -c conda-forge -y jupyter
$conda install -c conda-forge -y jupyterlab
$jupyter lab
profile
ImOk👌

0개의 댓글