OS: macOS Monterey( version: 12.1)
Anaconda : 4.11.0 (hoebrew install anaconda)
1. 가상환경 세팅
########################################################
## terminal 환경에서 진행
# anaconda env create
$ conda env create --name pipeline
# anaconda kernel install
$ conda actiavate pipeline
$ conda install -c conda-forge ipykernel
$ python -m pip install ipykernel --name pipeline
########################################################
2. Jupyter Lab|Notebook 에서 package 설치
########################################################
import sys
!conda install -c conda-forge -y --prefix {sys.prefix} pandas
#!conda install -c conda-forge -y --prefix {sys.prefix} {패키지 이름}
{sys.prefix} 를 넣어 줘어야 해당 커널에 해당 패키지 설치 가능
해당 유저마다, sys.prefix 를 환경 변수로 넣을 수 있으나, 해당 유저에서 jupyter 실행 시 kernel 에 설치 하는 것이 아닌,
환경 변수에 넣은 가상환경에 설치 하므로 해당 내용 인지하여 설정 필요
Ref.
https://jakevdp.github.io/blog/2017/12/05/installing-python-packages-from-jupyter/
Installing Python Packages from a Jupyter Notebook | Pythonic Perambulations
$PATH lists the directories, in order, that will be searched for any executable: for example, if I type python on my system with the above $PATH, it will first look for /Users/jakevdp/anaconda/envs/python3.6/bin/python, and if that doesn't exist it will lo
jakevdp.github.io
https://docs.conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html
Environment variables — conda-build 3.21.7+6.g0c03e28a.dirty documentation
During the build process, the following environment variables are set, on Windows with bld.bat and on macOS and Linux with build.sh. By default, these are the only variables available to your build script. Unless otherwise noted, no variables are inherited
docs.conda.io
'개발공부 > Anaconda' 카테고리의 다른 글
Anaconda jupyter error (0) | 2022.01.20 |
---|