過年機(jī)器還有些沒發(fā)貨,先在筆記本上演練下裝環(huán)境。
肯定是docker+deepo+jupyter+wing ide組合了。各種優(yōu)點不說了,重點是不折騰+隨時隨地折騰。
win10 home + docker
docker for windows要求win pro以上。家庭版不支持hyper-v。docker-toolbox我是拒絕的,性能差??!于是參照這篇文章,操作如下:
1,新建cmd腳本,開啟hyper-v component:
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause
2,新建cmd腳本,開啟hyper-v containers:
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del containers.txt
Dism /online /enable-feature /featurename:Containers -All /LimitAccess /ALL
pause
3,重啟電腦
4,改注冊表\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion :
EditionID鍵值改為 Professional
5,安裝docker for windows(最新的好像不行),官網(wǎng)很慢我下載的這個里面的Docker Windows 18.06.1-ce-win73。
6,搞定。
deepo
著名的image,筆記本不支持cuda,所以我裝的tag是:py36-jupyter-cpu。
啟動命令:docker run -it -p 8888:8888 ufoym/deepo:py36-jupyter-cpu jupyter notebook --no-browser --ip=0.0.0.0 --allow-root --NotebookApp.token= --notebook-dir='/root'
瀏覽器鏈接http://localhost:8888搞定。
網(wǎng)頁上新開terminal,安裝jupyter插件:
pip install jupyter_contrib_nbextensions
pip install jupyter_nbextensions_configurator
jupyter contrib nbextension install --user
jupyter nbextension enable execute_time/ExecuteTime
pip install ipywidgets
pip install qgrid
pip install RISE
jupyter-nbextension install rise --py --sys-prefix
jupyter-nbextension enable rise --py --sys-prefix
重啟jupyter,網(wǎng)頁上多了個Nbextensions標(biāo)簽頁,在這個頁面里,啟用各種插件