安装Miniconda3
到/usr/local
路径下。
%%bash
MINICONDA_INSTALLER_SCRIPT=Miniconda3-4.5.4-Linux-x86_64.sh
MINICONDA_PREFIX=/usr/local
wget https://repo.continuum.io/miniconda/$MINICONDA_INSTALLER_SCRIPT
chmod +x $MINICONDA_INSTALLER_SCRIPT
./$MINICONDA_INSTALLER_SCRIPT -b -f -p $MINICONDA_PREFIX
查看版本号:
!conda --version
* 这时查看python版本已经是miniconda中自带的版本了,但是执行的还是/usr/local/bin/python下系统自带的版本。
%%bash
conda install --channel defaults conda --yes
conda update --channel defaults --all --yes
import sys
_ = (sys.path
.append("/usr/local/lib/python3.7/site-packages"))
添加完成之后 查看一下系统路径
import sys
sys.path
['',
'/env/python',
'/usr/lib/python37.zip',
'/usr/lib/python3.7',
'/usr/lib/python3.7/lib-dynload',
'/usr/local/lib/python3.7/dist-packages',
'/usr/lib/python3/dist-packages',
'/usr/local/lib/python3.7/dist-packages/IPython/extensions',
'/root/.ipython',
'/usr/local/lib/python3.7/site-packages']