Anacoda-jupyter配置
一. Anaconda
-
更新软件包
$ conda upgrade --all
-
安装软件包
$ conda install numpy $ conda remove package_name $ conda update package_name $ conda list $ conda search package_name
-
配置清华源
$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ $ conda config --set show_channel_urls yes
-
创建独立工作环境
# 创建python3环境,位于anaconda2/envs/mypy3目录下 $ conda create -n mypy3 python=3 # 创建python2环境 $ conda create -n py2 python=2 # 切换python工作空间py2 $ source activate py2 # 切换python工作空间py3 $ source activate py3
-
conda env
# 导出环境中的包 $ conda env export > py2.yaml name: py2 channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - defaults dependencies: - openssl=1.0.2l=0 - pip=9.0.1=py27_1 - python=2.7.13=0 - readline=6.2=2 - setuptools=27.2.0=py27_0 - sqlite=3.13.0=0 - tk=8.5.18=0 - wheel=0.29.0=py27_0 - zlib=1.2.8=3 prefix: /home/lj/anaconda2/envs/py2 #列出所有环境,默认环境为ROOT $ conda env list # 删除指定环境 $ conda env remove -n env_name
-
安装jupyter notebook
$ conda install jupyter notebook
二. jupyter
-
修改jupyter服务密码
(1)生成配置文件$ jupyter notebook --generate-config
(2)计算hash值的密码,进入ipython,键入如下代码
shell In [1]: from notebook.auth import passwd In [2]: passwd() Enter password: Verify password: Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
-
修改配置文件:
vim ~/.jupyter/jupyter_notebook_config.py 增加配置项 c.NotebookApp.password = u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
-
启动服务
jupyter notebook --ip=0.0.0.0 --allow-root
-
cloud9
node server.js --listen 0.0.0.0 -a admin:123456 -p 8888