CentOS7 Anaconda 환경 구축
1. 환경
4vCore, 8GB 메모리, 20GB
2. SELINUX 비활성화
1) SEINUX 설정에서 비활성화 설정
sed 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
2) 현재 활성화된 SELINUX 비활성화
setenforce 0
3. 아나콘다 설치
1) 아나콘다 홈페이지(http://anaconda.com)에서 최신 설치스크립트 주소 확인 후 다운로드
wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh
2) 스크립트 실행
sh Anaconda3-2022.10-Linux-x86_64.sh
In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>> 엔터 Do you accept the license terms? [yes|no] [no] >>> yes /root/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/root/anaconda3] >>> 엔터 Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no] [no] >>> yes
4. conda 가상환경 생성
1) 기본 환경인 base를 복제하여 사용
conda create --name test_env --clone base
2) 가상 환경 전환
conda activate test_env
5. jupyter notebook 설치
1) 설치
conda install jupyter notebook
2) 기본 환경 설정 파일 생성
jupyter-notebook --generate-config
3) ipython 명령 실행
ipython
In [1]: from notebook.auth import security In [2]: security.passwd() Enter password: Verify password: Out[2]: '암호화된 패스워드' In [3]: exit()
4) jupyter notebook 실행파일 수정(참고한 블로그)
vim .jupyter/jupyter_notebook_config.py
44L c.JupyterApp.config_file_name = 'jupyter_notebook_config.py' 83L c.NotebookApp.allow_origin = '10.0.0.100' 297L c.NotebookApp.ip = '0.0.0.0' 401L c.NotebookApp.open_browser = False 412L c.NotebookApp.password = '암호화된 패스워드'
5) jupyter notebook 서버 구동(테스트 환경이라 root에서 바로 실행)
nohup jupyter notebook --allow-root &
6) jupyter notebook 방화벽 오픈
firewall-cmd --permanent --zone=public --add-port=8888/tcp
success
firewall-cmd --reload
success