centos7 和ubuntu下搭建 jupyter notebook,配置R环境
2018-01-21 13:02
956 查看
更简单的安装方法:
下载anaconda,这是一个包含很多常用科学计算的包,不用自己再重新安装了
在目录下sh xx.sh剩下的就简单了,同意协议等
然后就安装好了,如果输入conda 提示报错的话可以:source /root/.bashrc使写入环境变量的文件生效
如果是服务器上的话可以输入ipython:In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:64341aa9b492:97596b3b.....58e145261ca4f9562158a581b'复制下生成的密文
然后yum install vim
jupyter notebook --generate-config
sudo vim /root/.jupyter/jupyter_notebook_config.py在配置文件里最后一行加入c.NotebookApp.ip = '*'
c.NotebookApp.password = u'' #输入刚刚复制的密文
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888允许8888这个端口可以访问/sbin/iptables -I INPUT -p tcp --dport 8888 -j ACCEPT然后输入jupyter notebook或者把启动文件写入脚本中或者直接输入下面的这行,后台运行jupyter notebook >/dev/null 2>&1 &配置R环境conda install r r-essentials
下面的是以前的方法,大家随便看看吧……
安装jupyterpip3 install jupyter
配置jupyter notebook
创建目录/root/notebook/jupyter/root作为jupyter notebook的根目录
终端输入ipython,获得notebook加密后的密码
from IPython.lib import passwd
passwd() #得到加密后的hash
exit生成配置文件
jupyter notebook --generate-config
vim ~/.jupyter/jupyter_notebook_config.py配置jupyter_notebook_config.py
c.NotebookApp.ip = '*'
c.NotebookApp.allow_root = True
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.password = u'sha1:...' #输入上面加密后得到的密文
c.ContentsManager.root_dir = '/root/notebook/jupyter/root' #上面创建的目录运行
jupyter notebook后台运行
nohup jupyter notebook > /root/notebook/jupyter/jupyter.log 2>&1 &
如果无法运行可能是端口不允许访问
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 8888 -j ACCEPT
安装matplotlib模块
pip3 install matplotlib使用时使用在cell中要先输入
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-10, 11)
y = x**2
plt.plot(x, y)
plt.show()
from numpy.random import beta
import matplotlib.pyplot as plt
plt.style.use('bmh')
def plot_beta_hist(ax, a, b):
ax.hist(beta(a, b, size=10000), histtype="stepfilled",
bins=25, alpha=0.8, normed=True)
fig, ax = plt.subplots()
plot_beta_hist(ax, 10, 10)
plot_beta_hist(ax, 4, 12)
plot_beta_hist(ax, 50, 12)
plot_beta_hist(ax, 6, 55)
ax.set_title("'bmh' style sheet")
plt.show()
import random
import numpy as np
import matplotlib.pyplot as plt
from mat
bac5
plotlib import cm
from mpl_toolkits.mplot3d import Axes3D
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
fig = plt.figure()
ax = Axes3D(fig)
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.viridis)
plt.show()
安装tensorflow模块
pip3 install protobuf
pip3 install tensorflow
下载anaconda,这是一个包含很多常用科学计算的包,不用自己再重新安装了
在目录下sh xx.sh剩下的就简单了,同意协议等
然后就安装好了,如果输入conda 提示报错的话可以:source /root/.bashrc使写入环境变量的文件生效
如果是服务器上的话可以输入ipython:In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:64341aa9b492:97596b3b.....58e145261ca4f9562158a581b'复制下生成的密文
然后yum install vim
jupyter notebook --generate-config
sudo vim /root/.jupyter/jupyter_notebook_config.py在配置文件里最后一行加入c.NotebookApp.ip = '*'
c.NotebookApp.password = u'' #输入刚刚复制的密文
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888允许8888这个端口可以访问/sbin/iptables -I INPUT -p tcp --dport 8888 -j ACCEPT然后输入jupyter notebook或者把启动文件写入脚本中或者直接输入下面的这行,后台运行jupyter notebook >/dev/null 2>&1 &配置R环境conda install r r-essentials
下面的是以前的方法,大家随便看看吧……
安装jupyterpip3 install jupyter
配置jupyter notebook
创建目录/root/notebook/jupyter/root作为jupyter notebook的根目录
终端输入ipython,获得notebook加密后的密码
from IPython.lib import passwd
passwd() #得到加密后的hash
exit生成配置文件
jupyter notebook --generate-config
vim ~/.jupyter/jupyter_notebook_config.py配置jupyter_notebook_config.py
c.NotebookApp.ip = '*'
c.NotebookApp.allow_root = True
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.password = u'sha1:...' #输入上面加密后得到的密文
c.ContentsManager.root_dir = '/root/notebook/jupyter/root' #上面创建的目录运行
jupyter notebook后台运行
nohup jupyter notebook > /root/notebook/jupyter/jupyter.log 2>&1 &
如果无法运行可能是端口不允许访问
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 8888 -j ACCEPT
安装matplotlib模块
pip3 install matplotlib使用时使用在cell中要先输入
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-10, 11)
y = x**2
plt.plot(x, y)
plt.show()
from numpy.random import beta
import matplotlib.pyplot as plt
plt.style.use('bmh')
def plot_beta_hist(ax, a, b):
ax.hist(beta(a, b, size=10000), histtype="stepfilled",
bins=25, alpha=0.8, normed=True)
fig, ax = plt.subplots()
plot_beta_hist(ax, 10, 10)
plot_beta_hist(ax, 4, 12)
plot_beta_hist(ax, 50, 12)
plot_beta_hist(ax, 6, 55)
ax.set_title("'bmh' style sheet")
plt.show()
import random
import numpy as np
import matplotlib.pyplot as plt
from mat
bac5
plotlib import cm
from mpl_toolkits.mplot3d import Axes3D
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
fig = plt.figure()
ax = Axes3D(fig)
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.viridis)
plt.show()
安装tensorflow模块
pip3 install protobuf
pip3 install tensorflow
相关文章推荐
- 深度学习环境搭建:linux下 Ubuntu16.04+cuda8.0+cudnn+anaconda+tensorflow并配置远程访问jupyter notebook
- 深度学习环境搭建:linux下 Ubuntu16.04+cuda8.0+cudnn+anaconda+tensorflow并配置远程访问jupyter notebook
- Ubuntu 16.04 LTS 配置 Jupyter notebook 为服务器
- jupyter notebook conda Ipython环境配置for ML
- jupyter notebook 配置 scala、spark、python等环境
- jupyter notebook + pyspark 环境搭建
- win7系统 深度学习环境 anaconda+tensorflow+jupyter notebook轻松搭建
- Ubuntu jupyter notebook使用virtualenv环境
- 利用Anaconda搭建TensorFlow环境并在Jupyter Notebook使用
- 搭建PXE全自动系统安装配置环境(分别使用CentOS和Ubuntu做安装源)
- 服务器 配置 Jupyter notebook 远程访问 (Ubuntu 14.04)
- 用Docker在Ubuntu下 设置一个完整的Python + TensorFlow + GPU support + jupyter notebook + Deep Learning 开发环境
- Windows下配置jupyter notebook的python3与R运行环境
- 搭建ubuntu+firefox+jupyter+python3+selenium的环境
- Mac下Jupyter(即IPython-notebook)的搭建及使用(更建议安装Anaconda环境直接自带jupyter notebook)
- Ubuntu-16.04 R 安装及Jupyter notebook 配置
- Docker: 使用jupyter notebook基础镜像搭建自己的 pytorch 开发环境
- Caffe学习系列(13):数据可视化环境(python接口)配置 jupyter notebook
- Windows, Ubuntu 下 Numpy, Scipy, matplotlib, jupyter notebook 安装配置
- ubuntu系统下安装anaconda2并配置tensorflow环境及jupyter notebook工具远程登陆来开发用于深度学习环境