Jupyter 환경에서 conda env package 설치 시 아래 오류 발생
WARNING conda.core.envs_manager:register_env(50): Unable to register environment. Path not writable or missing.
해당 오류 뿐만 아니라, jupyter 가상 환경에서 커널 설정 및 패키지 import 에러 발생
OS : Mac Monterey 12.1
Anaconda : 4.11.0
Python : 3.9.7
pip: 21.3.1
Anaconda, python 은 homebrew 통하여 설치
# anaconda, python 설치
brew install anaconda
brew install python
# anaconda 가상환경에서 패키지 설치 하기 위하여 anaconda 변수 파일 권한 설정 변경
chown -R mdgome:staff ~/.conda
chmod -R u+x ~/.conda
# anaconda 가상환경 생성 및 접속
conda create --name {env name}
source activate {env name}
# python kernel 설치
python -m pip install -U pip
python -m pip install ipykernel
python -m ipykernel install --name {env name} --user
jupyter lab
이미 생성된 파일은 아래에서 pipeline 쪽 클릭하여 커널 변경
새로 생성하는 파일은 kernel 선택하여 생성
Jupyter 환경에서 가상환경에 패키지 설치
import os
prefix = os.getenv('CONDA_PREFIX')
!conda install -y -c conda-forge --prefix {prefix} 패키지 이름
'개발공부 > Anaconda' 카테고리의 다른 글
Jupyter 에서 python package install (0) | 2022.01.18 |
---|