==========================================================================
安装anaconda 3 64位版本
cd /opt
mkdir software
cd software
若wget 不存在,yum install wget
wget https://repo.anaconda.com/archive/Anaconda3-2018.12-Linux-x86_64.sh
chmod 777 Anaconda3-2018.12-Linux-x86_64.sh
./Anaconda3-2018.12-Linux-x86_64.sh
选择默认
==========================================================================
建立anaconda的软链接
ln /root/anaconda3/bin/conda /usr/bin/conda
==========================================================================
创建python3.7环境
conda create -n python37 python=3.7
source activate
source deactivate
conda activate python37
==========================================================================
安装pyalgotrade
pip install pyalgotrade -i https://pypi.tuna.tsinghua.edu.cn/simple/
cd /root/anaconda3/envs/python37/lib/python3.7/site-packages/pyalgotrade/
==========================================================================
安装jupyter和jupyterlab
pip install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install jupyterlab -i https://pypi.tuna.tsinghua.edu.cn/simple/
==========================================================================
设置jupyter远程访问
jupyter notebook --generate-config
生成密码
打开ipython,创建一个密文的密码:
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:51bc6f12cfa3:b1cb64766db2c22ce2e915d6b9e4568ca40ec79e'
把生成的密文‘sha:51…’复制下来
修改默认配置文件
$vim ~/.jupyter/jupyter_notebook_config.py
进行如下修改:
c.NotebookApp.ip='0.0.0.0'
c.NotebookApp.password = u'sha:51...刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #随便指定一个端口
==========================================================================
启动jupyterlab
cd /root/anaconda3/envs/python37/lib/python3.7/site-packages/pyalgotrade
jupyter lab --allow-root