Posted 鐞嗘兂澶ч檰
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了相关的知识,希望对你有一定的参考价值。
浠庢湰绡囧紑濮嬶紝灏嗚繘鍏ョ涓夌瘒瀹炴垬鍐呭锛岃涓€璁叉€庢牱鎼缓涓€涓殢韬殑浜戞暟鎹紪绋嬪疄楠屽锛岃浣犲彲浠ラ殢鏃堕殢鍦颁娇鐢ㄥ悇绉?span class="mq-6">缂栫▼璇█澶勭悊銆佸垎鏋愭暟鎹瓑绛夈€傛湰绡囧瘜鍚赴瀵岀殑鐭ヨ瘑鐐癸紝濡傛灉浣犺兘鍧氭寔鐪嬪畬骞跺疄璺典笅鏉ワ紝鑲畾浼氭敹鑾蜂笉灏戯紝鎰熷叴瓒g殑璇濇杩庢寔缁叧娉ㄥ摕
浜戣绠楃郴鍒楁枃绔犵储寮曢摼鎺ヰ煍楀缓璁繕娌$湅杩囩殑鍚屽鍏堢偣鍑讳互涓嬫枃绔犱綔涓洪澶囩煡璇嗭細
1銆?/span>
2銆?br>
3銆?br>
4銆?/span>
0.瀹為檯杩愯鏁堟灉
閫氳繃iPad杩滅▼璁块棶浜戠鏁版嵁瀹為獙瀹ゆ晥鏋?/span>
浣犳兂璁╀綘鐨勬墜鏈恒€佸钩鏉裤€佺數鑴戝彧瑕佹墦寮€娴忚鍣紝灏辫兘闅忔椂闅忓湴璁块棶灞炰簬浣犺嚜宸辩殑浜戠鏁版嵁瀹為獙瀹ゅ悧浣犲彲浠ラ殢鏃跺湪浣犵殑浜戞暟鎹疄楠屽閲?/span>杩?/span>琛?/span>杩滅▼缂栫▼銆佽繍绠椼€佷綔鍥俱€佸啓LaTeX銆佸啓鐖櫕銆佸鐞嗘暟鎹€?span class="mq-47">璁粌绁炵粡缃戠粶妯″瀷銆佸洖娴嬭偂绁ㄧ瓥鐣ョ瓑绛?/span>鍙湁浣犳兂涓嶅埌锛屾病鏈夊畠鍋氫笉鍒般€?/span>
瀵逛簬鎴戞潵璇达紝骞冲父鐢ㄧ殑鏈€澶氱殑渚挎槸Python鍜屼竴浜涘墠绔瑷€锛屽鏋滄墜杈圭殑鐢佃剳涓嶆槸鎴戣嚜宸辩殑鎴栬€呴噸瑁呰繃绯荤粺锛屾垜灏卞緱閲嶆柊涓嬭浇缂栫▼璇█鐜銆佸畨瑁呴澶栫殑渚濊禆搴撶瓑绛夛紝寰堥夯鐑﹁繕娴垂鏃堕棿銆傚鏋滆兘灏嗙紪绋嬬幆澧冩惉鍒颁簯涓婏紝閭e氨鍙互鍍忎笂鍥?span>鈫?/strong>鎵€绀猴紝鍋氬埌鏃犺璁惧鍜岀幆澧冿紝Anytime & Anywhere锛岄殢鏃堕殢鍦版搷浣滃睘浜庤嚜宸辩殑浜戞暟鎹疄楠屽銆?/span>
1.浠嬬粛涓ゆ鍒╁櫒
棣栧厛涓哄ぇ瀹朵粙缁嶄竴涓嬫垜甯哥敤鐨勪袱娆惧彲浠ヨ繙绋嬩娇鐢ㄧ殑缂栫▼宸ュ叿锛屼竴涓槸鐢ㄤ簬Python缂栫▼鍙婃暟鎹鐞嗙殑Anaconda锛屽彟涓€涓槸鐢ㄤ簬鍓嶇绛夊叾浠栫敤閫旂殑VSCode銆傝繖涓よ€呴兘鍙牚绉板悇鑷鍩熷唴鏈夊彛鐨嗙鐨勫伐鍏枫€?/span>
Anaconda[1] 锛堟剰鎬濇槸鍗楃編娲茶煉铔囷紝鎴戠寽寮€鍙戣€呬篃鏄负浜嗗懠搴擯ython杩欎釜锜掕泧馃悕锛夋槸涓€涓敤浜庣瀛﹁绠楃殑 Python 鍙戣鐗堬紝鍖呭惈浜嗕紬澶氭祦琛岀殑绉戝璁$畻銆佹暟鎹垎鏋愩€佹満鍣ㄥ涔犵瓑鐨?Python 宸ュ叿闆嗭紝鍙皳鏄憺澹啗鍒€锛屾湁浜嗗畠鍩烘湰涓婂彲浠ヨВ鍐虫垜浠敓娲汇€佸涔犮€佸伐浣滀腑纰板埌鐨?9%鐨勬鎵嬮棶棰樸€?/span>
杩欓噷涓昏璁茶Anaconda涓殑Jupyter Notebook[2]杩欎釜缁勪欢锛?span class="mq-82">Jupyter Notebook鏄竴涓氦浜掑紡缂栫▼鐨勭瑪璁版湰锛岄《閮ㄩ€氳繃缃戠粶杩愯鐨勬晥鏋滃浘灏辨槸闈犲畠銆備粠瀹冪殑Logo鍥惧彲浠ョ湅鍑猴紝瀹冩敮鎸丳ython銆丆#銆丣avascript銆丷uby銆丷銆丆++銆丼cale銆丒rlang绛?0绉嶇紪绋嬭瑷€锛岃繕鍙互涓庡綋浠婂悇绉嶅ぇ鏁版嵁骞冲彴濡係park銆丗link杩涜闆嗘垚锛岃繕鏈夎澶氶粦绉戞妧鍔熻兘鍙弬鑰僛3][4][5]銆傚綋骞存垜姣曚笟璁捐鐨勫ぇ鏁版嵁鐩稿叧璇鹃灏遍噰鐢↗upyter Notebook + Spark杩愯鍦ㄨ嚜寤虹殑灏忛泦缇や笂锛岀敤璧锋潵闈炲父鐖金煠?/span>
鏈変簡瀹冿紝灏卞彲浠ユ妸浣犵殑鏁版嵁瀹為獙瀹ゆ惉涓婁簯绔?span class="mq-85">锛屽嵆寮€鍗崇敤锛?/span>闅忚韩鎼哄甫锛屽摢鎬曠敤鎵嬫満涔熻兘闅忔椂闅忓湴閫氳繃娴忚鍣℅et浜戝己澶х殑璁$畻鑳藉姏銆?/span>
濡傛灉鐜板湪灏辨兂鍏堝皾璇曚竴涓嬶紝鍙互鐧婚檰[6]锛岃繖鏄疛upyter瀹樻柟鍦ㄧ嚎鐨凬otebook璇曠敤缃戠珯锛涢樋閲屼簯涔熷紑鏀句簡鍦ㄧ嚎鐨凧upyter Notebook[7]锛屼笉杩囩洰鍓嶅儳澶氱播灏戯紝闇€瑕佹帓闃熻繍琛屻€傘€傦紙鎵€浠ヨ繕鏄窡鐫€鎴戜笅闈㈢殑鍐呭鎼缓灞炰簬浣犺嚜宸变簯Notebook鍚э級
绗簩娆惧伐鍏蜂究鏄井杞棤蹇冩彃鏌虫煶鎴愯崼鐨勪骇鍝?/span>VSCode鈥斺€旈潪甯稿ソ鐢ㄧ殑浠g爜缂栬緫鍣ㄣ€傝櫧鐒跺井杞妧鏈偍澶囬泟鍘氾紝浣嗕篃涓€鐩村彈鍒朵簬鍘嗗彶鍖呰⒈鍜屽唴閮ㄥ畼鍍氫富涔夌殑鎺h倶锛岃澶氳蒋浠跺弽鑰屽緢闅剧敤鍚屾椂娌′粈涔堝ぇ杩涙锛堝锛岃鐨勫氨鏄疻in10Office锛変笉杩嘨SCode杩樼湡鏄釜渚嬪锛屼竴鎺ㄥ嚭灏卞共缈讳簡鏇剧粡婊嬫鼎鐨凬otepad++銆丼ublimeText绛変竴绁ㄤ唬鐮佺紪杈戝櫒锛岀敋鑷虫垜瑙夊緱姣擥ithub鐨凙tom杩樺ソ鐢紝瀹屽叏涓嶅儚杈d釜鈥滅澶存补鑵诲ぇ鍙旔煈粹€濆井杞仛鍑虹殑浜у搧銆?/span>
閫氳繃浣跨敤VSCode鐨凴emote Development鎻掍欢锛屽彲浠ヨ鎴戜滑閫氳繃鏈湴璁$畻鏈哄垱寤恒€佺紪杈戙€佽繍琛屼簯绔湇鍔″櫒鐨勬枃浠跺拰浠g爜锛屽氨鍍忓湪鑷繁鐢佃剳涓婃搷浣滀竴鏍凤紝鑳芥瀬澶ф彁楂樼紪绋嬨€佽皟璇曠殑鏁堢巼銆?/span>
2.VSCode & 浜?/strong>
鐢变簬浣跨敤VSCode杩炴帴浜戠殑鏂规硶涓?/span>浣跨敤缁堢杩炴帴绫讳技锛屾楠ょ浉瀵圭畝鍗曪紝鎵€浠ュ厛浠庡畠璁茶捣銆?/span>
杩炴帴鎴愬姛鍚庡簳閮ㄥ浘鏍囧鍥炬墍绀猴紝浠h〃宸查€氳繃SSH閾炬帴鑷充簯锛?br>
3.浜戞暟鎹疄楠屽
1銆佸畨瑁匒naconda
杩欓噷2020骞?鏈堟渶鏂扮増鍦板潃涓猴細
mkdir installer && cd installer
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.02-Linux-x86_64.sh
bash Anaconda3-2020.02-Linux-x86_64.sh
杩欓噷浼氭彁绀轰綘鏄惁鎺ュ彈浣跨敤鏉℃锛岃緭鍏モ€測es鈥濆苟鍥炶溅锛?/span>
source ~/.bashrc
conda
濡傛灉鐪嬪埌浠ヤ笅鍐呭鍒欎唬琛ㄥ畨瑁呭畬姣曪細
2銆佸垏鎹naconda鏇存柊婧愯嚦鍥藉唴闀滃儚
鍦ㄤ簯绔疭hell涓緭鍏ヤ互涓嬪懡浠わ紝鍒囨崲Anaconda婧愯嚦鍥藉唴闀滃儚锛?/span>
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
鍒囨崲鍚庡啀杈撳叆鈥?/span>conda update --all鈥濓紝Anaconda浼氬垪鍑烘墍鏈夐渶瑕佹洿鏂扮殑package搴擄紝鐐瑰嚮鈥淵鈥濓紝渚垮彲浣跨敤鍥藉唴闀滃儚婧愬姞閫熸洿鏂帮細
pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple
鎺ヤ笅鏉ユ垜浠彲浠ュ湪缁堢杈撳叆鈥?/span>pip install mxnet鈥濓紝鏉ュ皾璇曞畨瑁匨XNet娣卞害瀛︿範妗嗘灦锛岀湅鐪嬩笅杞介€熷害鏈夋病鏈夎川鐨勬彁鍗囥€?/span>
jupyter notebook --generate-config
mkdir ~/code
绗竴鏉″懡浠ゅ湪浜戞湇鍔″櫒鐨勪富鏂囦欢澶瑰唴鍒涘缓浜咼upyter Notebook鐨勯厤缃枃浠讹紝鍚屾椂鏂板缓浜咰ode鏂囦欢澶圭敤鏉ュ綋浣淣otebook鐨勫伐浣滃尯銆?br mpa-from-tpl="t">
jupyter notebook password
Enter password: ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json
绗簩鏉″懡浠ゆ槸鐢ㄦ潵瀹夊叏璧疯锛岃缃湭鏉otebook鐨勭櫥闄嗗瘑鐮侊紝姝ゆ椂缁堢浼氭彁绀轰綘杈撳叆骞跺啀娆$‘璁よ緭鍏ヤ竴娆°€?/span>
cd ~/.jupyter
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout mykey.key -out mycert.pem
绗笁鏉″懡浠ゆ槸閫氳繃OpenSSL鍛戒护鍒涘缓10骞存湡鐨勮嚜绛惧悕璇佷功锛岀敤鏉ュNotebook鐨勭綉缁滀紶杈撹繘琛屽姞瀵嗭紙涓嶇劧浣犺緭鍏ョ殑鎵€鏈変唬鐮併€佸寘鎷綘鐨勭櫥闄嗗瘑鐮佸皢鍦ㄧ綉缁滄槑鏂囦紶杈?img src="/img?url=https://res.wx.qq.com/mpres/htmledition/images/icon/common/emotion_panel/smiley/smiley_36.png" data-ratio="1" data-w="20" _width="20px" alt="浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class="mq-279">锛夛紝涓€璺暡鍥炶溅鍗冲彲锛屽湪 .jupyter 鏂囦欢澶逛笅浼氬彂鐜板凡鍒涘缓濂界殑mykey.key 鍜?mycert.pem 瀵嗛挜鏂囦欢銆?/span>
鏈潵涓嬮潰瑕佸湪缁堢鍐呮暡鍛戒护鍘讳慨鏀瑰悇绉嶉厤缃枃浠讹紝瀵逛簬灏忕櫧鏄湁浜涘洶闅剧殑锛屼笉杩囪仾鏄庡鎴?img src="https://image.cha138.com/20210429/224a5cddc7f342e2a9c5546b9f422c74.jpg" data-ratio="1" data-w="20" _width="20px" alt="浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class="mq-284">宸茬粡甯︿綘浜嬪厛閰嶇疆濂戒簡VSCode锛?/span>鍚庨潰灏卞彲浠ュ埄鐢╒SCode绠€鍖栨楠ゃ€?/span>
鎵撳紑VSCode锛岃繛鎺ヨ嚦浣犵殑浜戞湇鍔″櫒锛岀偣鍑籚SCode鐨勨€?/span>鎵撳紑鏂囦欢澶?/span>鈥濆懡浠わ紝鍦ㄥ脊鍑虹獥鍙h緭鍏モ€?span>/root鈥濓紙杩欓噷瀵瑰簲鐨勬槸鍗庝负浜戠殑榛樿鐢ㄦ埛鍚嶏紝鍏朵粬浜戜骇鍝侀渶瑕佹浛鎹㈡垚 鈥? + 鐢ㄦ埛鍚嶁€濓級锛屾帴鐫€鍦ㄥ乏渚ц祫婧愮鐞嗗櫒灏卞彲鐪嬪埌浜戠涓荤敤鎴风殑鏂囦欢澶癸紝閫夋嫨閰嶇疆鏂囦欢澶光€?nbsp;.jupyter鈥濅笅鐨勨€?span>jupyter_notebook_config.json鈥濓紝鎵撳紑瀹冿細
c.NotebookApp.certfile = u'/root/.jupyter/mycert.pem'
c.NotebookApp.keyfile = u'/root/.jupyter/mykey.key'
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 9999
c.NotebookApp.notebook_dir = '/root/code'
绠€鍗曡鏄庝笅锛屽墠涓よ鎸囨槑浜嗙鍚嶈瘉涔﹀瓨鏀句綅缃紱绗笁琛岃Notebook鏈嶅姟鍣ㄧ粦瀹氭墍鏈塈P鏉ュ悜缃戠粶鍏紑锛涚鍥涜绮樿创鑷狫SON鍐呯殑Hashed瀵嗙爜锛涚浜旇鎸囧畾缃戠粶绔彛涓?999锛涚鍏鎸囧畾Notebook鐨勫伐浣滃尯鏂囦欢澶广€?/span>
鑷虫浜戞湇鍔″櫒绔疦otebook閰嶇疆瀹屾瘯銆?/span>
5銆佸紑鏀句簯鏈嶅姟鍣ㄧ浉搴旂綉缁滅鍙?/strong>
鐢变簬瀹夊叏鑰冭檻锛屽悇瀹朵簯鍦ㄩ粯璁ゆ椂鍙紑鏀句簡灏戞暟鍑犱釜蹇呴』鐨勭綉缁滅鍙o紝鎴戜滑鎺ヤ笅鏉ラ渶瑕佽浜戞湇鍔″櫒寮€鏀炬垜浠琋otebook鐨?span>9999绔彛锛岃繖鏍锋墠鑳介€氳繃浜掕仈缃戞甯歌闂畠銆傝繖閲屼互鍗庝负浜戜负渚嬶紙鍏朵粬鍘傚晢鎿嶄綔绫讳技锛屽弬鑰冨悇鑷畼鏂规枃妗e嵆鍙級銆?/span>
鐧婚檰浜戞湇鍔″櫒鐨勭綉椤垫帶鍒跺彴鐣岄潰锛岀偣閫変綘鐨勪簯鏈嶅姟鍣紝璺宠浆鍒版瑙堥〉闈紝鐐瑰嚮銆愬畨鍏ㄧ粍銆戞爣绛撅細
鏈€鍚庢垜浠皾璇曚竴涓嬪湪浜戞湇鍔″櫒涓婂惎鍔↗upyter Notebook鏈嶅姟锛屽湪杩滅▼缁堢杈撳叆浠ヤ笅鍛戒护锛?/span>
jupyter notebook --allow-root
cp /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service
[Install]
WantedBy=multi-user.target
Alias=rc-local.service
鎴戣繖閲屼娇鐢ㄧ殑鏄?/span>nano鏉ョ紪杈戯紝瀹屾瘯鍚庝繚瀛橈紙瑕佷範鎯敤鍛戒护琛?img src="/img?url=https://res.wx.qq.com/mpres/htmledition/images/icon/common/emotion_panel/emoji_wx/Watermelon.png" data-ratio="1" data-w="20" _width="20px" alt="浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class="mq-406">锛変慨鏀规晥鏋?span class="mq-407">濡備笅锛?/span>
mkdir ~/log && touch /etc/rc.local && nano /etc/rc.local
灏嗕互涓嬪唴瀹硅緭鍏ヨ嚦rc.local骞朵繚瀛橈細
#!/bin/bash
nohup /root/anaconda3/bin/jupyter notebook --allow-root >>/root/log/jupyter.log 2>&1 &
浠ヤ笂浠g爜浣滅敤鏄鏈嶅姟鍣ㄥ紑鏈哄悗鑷姩鍦ㄥ悗鍙板惎鍔∟otebook鏈嶅姟锛屽苟鎶婅繍琛屾棩蹇楀啓鍏ュ埌 jupyter.log 鏂囦欢閲屻€?/span>
涓嬩竴姝ヤ负rc.local娣诲姞鍙墽琛屾潈闄愶紝骞跺惎鐢ㄨ鏈嶅姟锛?/span>
chmod +x /etc/rc.local
systemctl enable rc-local
systemctl start rc-local.service
鎺ヤ笅鏉ラ噸鍚簯鏈嶅姟鍣紝杈撳叆鍛戒护 systemctl status rc-local 鏉ユ楠屾槸Notebook鏈嶅姟鏄惁鎴愬姛鍚姩锛岃嫢涓轰笅鍥炬墍绀哄垯浠h〃鎴愬姛锛堝叿浣撳悇涓懡浠ょ殑鍚箟鏈夊叴瓒e彲鍙傝€僛10][11]锛?/span>锛?/span>
鐜板湪浣犲凡缁忔嫢鏈変簡24灏忔椂鈽€馃寵鍏ㄥぉ鍊欑殑浜戞暟鎹疄楠屽锛岀湡姝g殑Anytime & Anywhere锛岃刀蹇€氳繃娴忚鍣ㄨ闂湅鐪嬪惂~
鍥犱负鎴戠粡甯镐娇鐢˙lender鍋?D锛屾€庢牱璁╀簯鏈嶅姟鍣ㄦ垚涓烘垜鐨?4灏忔椂娓叉煋涓绘満锛屼换鍔充换鎬ㄤ负鎴戞覆鏌?D椤圭洰锛?/span>
1銆丄naconda瀹樼綉
https://www.anaconda.com
2銆丣upyter瀹樼綉
https://jupyter.org/
3銆丣upyter Notebook 鍙互鍋氬摢浜涗簨鎯咃紵鈥斺€旂煡涔?/span>
https://www.zhihu.com/question/46309360
4銆?/span>鍏ラ棬 | 濮嬩簬Jupyter Notebooks锛氫竴浠藉叏闈㈢殑鍒濆鑰呭疄鐢ㄦ寚鍗?/span>
https://cloud.tencent.com/developer/article/1146913
5銆?/span>鍙湁鎯充笉鍒帮紝銆?9銆嶇鎵╁睍Jupyter鍔熻兘鐨勫ソ鏂规硶
https://cloud.tencent.com/developer/article/1462379
https://jupyter.org/try
https://tianchi.aliyun.com/notebook-ai
https://mirrors.tuna.tsinghua.edu.cn
以上是关于的主要内容,如果未能解决你的问题,请参考以下文章