缂栫▼璇█澶勭悊銆佸垎鏋愭暟鎹瓑绛夈€傛湰绡囧瘜鍚赴瀵岀殑鐭ヨ瘑鐐癸紝濡傛灉浣犺兘鍧氭寔鐪嬪畬骞跺疄璺典笅鏉ワ紝鑲畾浼氭敹鑾蜂笉灏戯紝鎰熷叴瓒g殑璇濇杩庢寔缁叧娉ㄥ摕浜戣绠楃郴鍒楁枃绔犵储寮曢摼鎺ヰ"/>

Posted 鐞嗘兂澶ч檰

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了相关的知识,希望对你有一定的参考价值。




浠庢湰绡囧紑濮嬶紝灏嗚繘鍏ョ涓夌瘒瀹炴垬鍐呭锛岃涓€璁叉€庢牱鎼缓涓€涓殢韬殑浜戞暟鎹紪绋嬪疄楠屽锛岃浣犲彲浠ラ殢鏃堕殢鍦颁娇鐢ㄥ悇绉?span class="mq-6">缂栫▼璇█澶勭悊銆佸垎鏋愭暟鎹瓑绛夈€傛湰绡囧瘜鍚赴瀵岀殑鐭ヨ瘑鐐癸紝濡傛灉浣犺兘鍧氭寔鐪嬪畬骞跺疄璺典笅鏉ワ紝鑲畾浼氭敹鑾蜂笉灏戯紝鎰熷叴瓒g殑璇濇杩庢寔缁叧娉ㄥ摕浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=

浜戣绠楃郴鍒楁枃绔犵储寮曢摼鎺ヰ煍楀缓璁繕娌$湅杩囩殑鍚屽鍏堢偣鍑讳互涓嬫枃绔犱綔涓洪澶囩煡璇嗭細
1銆?/span>

2銆?br>

3銆?br>

4銆?/span>


P.S.   鍦ㄦ湰鍏紬鍙锋秷鎭晫闈㈠洖澶?nbsp; vscode  锛屽彲浠ョ珛鍒昏幏鍙栧井杞畼鏂逛笅杞藉湴鍧€


0.瀹為檯杩愯鏁堟灉


浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></p> 
<section class= 閫氳繃iPad杩滅▼璁块棶浜戠鏁版嵁瀹為獙瀹ゆ晥鏋?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></span> 
</section> 
<section class= 閫氳繃浠绘剰鐢佃剳杩滅▼璁块棶浜戠鏁版嵁瀹為獙瀹ゆ晥鏋?/span>

浣犳兂璁╀綘鐨勬墜鏈恒€佸钩鏉裤€佺數鑴戝彧瑕佹墦寮€娴忚鍣紝灏辫兘闅忔椂闅忓湴璁块棶灞炰簬浣犺嚜宸辩殑浜戠鏁版嵁瀹為獙瀹ゅ悧浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=浣犲彲浠ラ殢鏃跺湪浣犵殑浜戞暟鎹疄楠屽閲?/span>杩?/span>琛?/span>杩滅▼缂栫▼銆佽繍绠椼€佷綔鍥俱€佸啓LaTeX銆佸啓鐖櫕銆佸鐞嗘暟鎹€?span class="mq-47">璁粌绁炵粡缃戠粶妯″瀷銆佸洖娴嬭偂绁ㄧ瓥鐣ョ瓑绛?/span>浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=鍙湁浣犳兂涓嶅埌锛屾病鏈夊畠鍋氫笉鍒般€?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=閫氳繃鎵嬫満鍦ㄤ簯绔繍琛岀缁忕綉缁滆繘琛屽浘鐗囪涔夊垎鍓?/span>

瀵逛簬鎴戞潵璇达紝骞冲父鐢ㄧ殑鏈€澶氱殑渚挎槸Python鍜屼竴浜涘墠绔瑷€锛屽鏋滄墜杈圭殑鐢佃剳涓嶆槸鎴戣嚜宸辩殑鎴栬€呴噸瑁呰繃绯荤粺锛屾垜灏卞緱閲嶆柊涓嬭浇缂栫▼璇█鐜銆佸畨瑁呴澶栫殑渚濊禆搴撶瓑绛夛紝寰堥夯鐑﹁繕娴垂鏃堕棿銆傚鏋滆兘灏嗙紪绋嬬幆澧冩惉鍒颁簯涓婏紝閭e氨鍙互鍍忎笂鍥?span>鈫?/strong>鎵€绀猴紝鍋氬埌鏃犺璁惧鍜岀幆澧冿紝Anytime & Anywhere锛岄殢鏃堕殢鍦版搷浣滃睘浜庤嚜宸辩殑浜戞暟鎹疄楠屽銆?/span>



1.浠嬬粛涓ゆ鍒╁櫒


棣栧厛涓哄ぇ瀹朵粙缁嶄竴涓嬫垜甯哥敤鐨勪袱娆惧彲浠ヨ繙绋嬩娇鐢ㄧ殑缂栫▼宸ュ叿锛屼竴涓槸鐢ㄤ簬Python缂栫▼鍙婃暟鎹鐞嗙殑Anaconda锛屽彟涓€涓槸鐢ㄤ簬鍓嶇绛夊叾浠栫敤閫旂殑VSCode銆傝繖涓よ€呴兘鍙牚绉板悇鑷鍩熷唴鏈夊彛鐨嗙鐨勫伐鍏枫€?/span>

Anaconda[1] 锛堟剰鎬濇槸鍗楃編娲茶煉铔囷紝鎴戠寽寮€鍙戣€呬篃鏄负浜嗗懠搴擯ython杩欎釜锜掕泧馃悕锛夋槸涓€涓敤浜庣瀛﹁绠楃殑 Python 鍙戣鐗堬紝鍖呭惈浜嗕紬澶氭祦琛岀殑绉戝璁$畻銆佹暟鎹垎鏋愩€佹満鍣ㄥ涔犵瓑鐨?Python 宸ュ叿闆嗭紝鍙皳鏄憺澹啗鍒€锛屾湁浜嗗畠鍩烘湰涓婂彲浠ヨВ鍐虫垜浠敓娲汇€佸涔犮€佸伐浣滀腑纰板埌鐨?9%鐨勬鎵嬮棶棰樸€?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<section class= Jupy ter  Logo

杩欓噷涓昏璁茶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>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></span></p> 
<p class=濡傛灉鐜板湪灏辨兂鍏堝皾璇曚竴涓嬶紝鍙互鐧婚檰[6]锛岃繖鏄疛upyter瀹樻柟鍦ㄧ嚎鐨凬otebook璇曠敤缃戠珯锛涢樋閲屼簯涔熷紑鏀句簡鍦ㄧ嚎鐨凧upyter Notebook[7]锛屼笉杩囩洰鍓嶅儳澶氱播灏戯紝闇€瑕佹帓闃熻繍琛屻€傘€傦紙鎵€浠ヨ繕鏄窡鐫€鎴戜笅闈㈢殑鍐呭鎼缓灞炰簬浣犺嚜宸变簯Notebook鍚э級

绗簩娆惧伐鍏蜂究鏄井杞棤蹇冩彃鏌虫煶鎴愯崼鐨勪骇鍝?/span>VSCode鈥斺€旈潪甯稿ソ鐢ㄧ殑浠g爜缂栬緫鍣ㄣ€傝櫧鐒跺井杞妧鏈偍澶囬泟鍘氾紝浣嗕篃涓€鐩村彈鍒朵簬鍘嗗彶鍖呰⒈鍜屽唴閮ㄥ畼鍍氫富涔夌殑鎺h倶锛岃澶氳蒋浠跺弽鑰屽緢闅剧敤鍚屾椂娌′粈涔堝ぇ杩涙锛堝锛岃鐨勫氨鏄疻in10浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=Office锛変笉杩嘨SCode杩樼湡鏄釜渚嬪锛屼竴鎺ㄥ嚭灏卞共缈讳簡鏇剧粡婊嬫鼎鐨凬otepad++銆丼ublimeText绛変竴绁ㄤ唬鐮佺紪杈戝櫒锛岀敋鑷虫垜瑙夊緱姣擥ithub鐨凙tom杩樺ソ鐢紝瀹屽叏涓嶅儚杈d釜鈥滅澶存补鑵诲ぇ鍙旔煈粹€濆井杞仛鍑虹殑浜у搧銆?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<section class= VSCode瀹樻柟涓婚〉灞曠ず

閫氳繃浣跨敤VSCode鐨凴emote Development鎻掍欢锛屽彲浠ヨ鎴戜滑閫氳繃鏈湴璁$畻鏈哄垱寤恒€佺紪杈戙€佽繍琛屼簯绔湇鍔″櫒鐨勬枃浠跺拰浠g爜锛屽氨鍍忓湪鑷繁鐢佃剳涓婃搷浣滀竴鏍凤紝鑳芥瀬澶ф彁楂樼紪绋嬨€佽皟璇曠殑鏁堢巼銆?/span>



2.VSCode & 浜?/strong>


鐢变簬浣跨敤VSCode杩炴帴浜戠殑鏂规硶涓?/span>浣跨敤缁堢杩炴帴绫讳技锛屾楠ょ浉瀵圭畝鍗曪紝鎵€浠ュ厛浠庡畠璁茶捣銆?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=瀹夎瀹屾瘯鍚庡惎鍔╒SCode锛岀偣鍑诲乏渚хН鏈ㄧ姸鐨勨€滄墿灞曗€濆浘鏍囨垨蹇嵎閿?span>Ctrl+Shift+X锛屾墦寮€鎵╁睍闈㈡澘锛屽湪宸︿笂鎼滅储妗嗕腑杈撳叆鈥?span>Remote Development鈥濓紝鎼滅储骞跺畨瑁呰鎵╁睍锛?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=瀹夎瀹屾瘯鍚庡彲鑳介渶瑕侀噸鍚疺SCode锛屽啀鐐瑰嚮宸︿笅瑙掔殑姗欒壊鍙岀澶?/span>鈥?/span>><鈥濆浘鏍囷紝鐒跺悗鍦ㄥ脊鍑鸿彍鍗曢€夋嫨鈥?span>Remote SSH:Connect to Host...鈥濓細

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=鎺ヤ笅鏉ヤ笌SSH杩炴帴鍛戒护鐩稿悓锛屽湪寮瑰嚭杈撳叆妗嗕腑閿叆鍛戒护锛?/span>ssh 鐢ㄦ埛鍚岪浜戞湇鍔″櫒IP锛屽洖杞﹀悗鍐嶈緭鍏ヤ簯绔櫥褰曞瘑鐮侊細

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
 <span class=IP鍦板潃涓虹ず渚?/span>

杩炴帴鎴愬姛鍚庡簳閮ㄥ浘鏍囧鍥炬墍绀猴紝浠h〃宸查€氳繃SSH閾炬帴鑷充簯锛?br>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=鐜板湪浣犲氨鍙互鍍忓湪鏈満杩愯涓€鏍凤紝閫氳繃VSCode鍦ㄤ簯绔笂杩涜鍚勭鏂板缓銆佺紪杈戙€佷慨鏀广€佽皟璇曚唬鐮佺瓑鎿嶄綔锛屽悓鏃跺畠涔熺浉褰撲簬涓€涓繙绋嬫枃浠剁鐞嗗櫒锛屽彲浠ユ煡鐪嬩簯鏈嶅姟鍣ㄧ殑鎵€鏈夋枃浠躲€傛槸涓嶆槸寰堟柟渚匡紵



3.浜戞暟鎹疄楠屽


鑸掑彛姘?/span> 浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class= 浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class= 绻佺悙鐨勬搷浣滄潵浜嗭紙娑夊強鐭ヨ瘑鐐规瘮杈冨锛屼絾閮芥槸鏈夌敤鐨勫熀纭€鎿嶄綔锛屽鍒板氨鏄禋鍒板搱浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=~锛夈€?/span> 鎺ヤ笅鏉ユ垜浠潵鐪嬬湅濡備綍涓€姝ヤ竴姝ュ皢Jupyter Notebook鎼缓鍦ㄦ垜浠嚜宸辩殑浜戞湇鍔″櫒涓娿€?/span>
浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></span> 
</section> 
<section class=

1銆佸畨瑁匒naconda

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></p> 
<section class= 杩欓噷2020骞?鏈堟渶鏂扮増鍦板潃涓猴細

https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.02-Linux-x86_64.sh
mkdir installer && cd installer
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.02-Linux-x86_64.sh
浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<section class= wget鍛戒护姝e湪涓嬭浇Anaconda
涓嬭浇瀹屾瘯鍚庯紝閫氳繃浠ヤ笅鍛戒护杩愯瀹夎鍖咃細
bash Anaconda3-2020.02-Linux-x86_64.sh

杩欓噷浼氭彁绀轰綘鏄惁鎺ュ彈浣跨敤鏉℃锛岃緭鍏モ€測es鈥濆苟鍥炶溅锛?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=鎺ヤ笅鏉ヤ竴璺洖杞︼紝纰板埌璇㈤棶缁х画杈撳叆鈥測es鈥濆嵆鍙紝鏈€鍚庝究寮€濮嬪畨瑁咃細

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=瀹夎瀹屾瘯鍚庤寰楄緭鍏ヤ互涓嬪懡浠ゆ潵鍒锋柊浜戠Shell鐨勭幆澧冨彉閲忥紝鍐嶈緭鍏モ€渃onda鈥濋獙璇佹槸鍚﹀畨瑁呮纭細

source ~/.bashrc
conda

濡傛灉鐪嬪埌浠ヤ笅鍐呭鍒欎唬琛ㄥ畨瑁呭畬姣曪細

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<hr class=

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搴擄紝鐐瑰嚮鈥淵鈥濓紝渚垮彲浣跨敤鍥藉唴闀滃儚婧愬姞閫熸洿鏂帮細

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<section class= 鎰熷彈涓€涓嬩笅杞介€熷害鏈夋病鏈夊彉蹇紵

3銆佸垏鎹ython Pypi鏇存柊婧愯嚦鍥藉唴闀滃儚
Pypi鏄疨ython瀹樻柟鐨勬墿灞曞簱锛屾垜浠鏋滆璁㏄ython鍔熻兘鏇村己锛岀粡甯搁渶瑕侀€氳繃pip鍛戒护浠嶱ypi涓嬭浇鎵╁睍鍖咃紝鎴戜滑渚濇棫闇€瑕佸垏鎹㈣嚦鍥藉唴闀滃儚婧愶紝鏍规嵁鎴戠殑浜戞湇鍔″櫒鎴戣繖閲岄€夌敤鍗庝负寮€婧愰暅鍍忕殑Pypi婧愩€?/span>
棣栧厛鐧诲綍鍗庝负寮€婧愰暅鍍忕珯锛?/span> https://mirrors.huaweicloud.com/ 锛屾寜瀛楁瘝椤哄簭鍚戜笅鎷栧姩闀滃儚鍒楄〃鎵惧埌Pypi锛岀偣鍑诲脊鍑烘搷浣滄彁绀猴細
浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=鎴戜滑鎵撶畻璁句负榛樿Pypi婧愶紝鎵€浠ユ牴鎹彁绀哄唴瀹瑰湪浜戞湇鍔″櫒鐨勮繙绋婼SH缁堢杈撳叆浠ヤ笅鍛戒护锛屽叾涓悗闈㈢殑缃戝潃涓轰笂鍥句腑index-url鍚庨潰鐨勭綉鍧€锛?/span>

pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple

鎺ヤ笅鏉ユ垜浠彲浠ュ湪缁堢杈撳叆鈥?/span>pip install mxnet鈥濓紝鏉ュ皾璇曞畨瑁匨XNet娣卞害瀛︿範妗嗘灦锛岀湅鐪嬩笅杞介€熷害鏈夋病鏈夎川鐨勬彁鍗囥€?/span>


4銆侀厤缃甁upyter Notebook鏈嶅姟鍣?/strong>
瀹屾垚浠ヤ笂鍑嗗宸ヤ綔鍚庯紝鎺ヤ笅鏉ユ垜浠潃鎵嬪湪浜戜笂鏋勫缓Notebook鏈嶅姟銆傜涓€姝ヤ緷鏃у湪SSH缁堢杈撳叆浠ヤ笅鍛戒护锛?br mpa-from-tpl="t">
jupyter notebook --generate-configmkdir ~/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>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></span></span></p> 
<p class=鎵撳紑VSCode锛岃繛鎺ヨ嚦浣犵殑浜戞湇鍔″櫒锛岀偣鍑籚SCode鐨勨€?/span>鎵撳紑鏂囦欢澶?/span>鈥濆懡浠わ紝鍦ㄥ脊鍑虹獥鍙h緭鍏モ€?span>/root鈥濓紙杩欓噷瀵瑰簲鐨勬槸鍗庝负浜戠殑榛樿鐢ㄦ埛鍚嶏紝鍏朵粬浜戜骇鍝侀渶瑕佹浛鎹㈡垚 鈥? + 鐢ㄦ埛鍚嶁€濓級锛屾帴鐫€鍦ㄥ乏渚ц祫婧愮鐞嗗櫒灏卞彲鐪嬪埌浜戠涓荤敤鎴风殑鏂囦欢澶癸紝閫夋嫨閰嶇疆鏂囦欢澶光€?nbsp;.jupyter鈥濅笅鐨勨€?span>jupyter_notebook_config.json鈥濓紝鎵撳紑瀹冿細

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=涓轰簡閬垮厤浣犵殑鏄庢枃瀵嗙爜娉勯湶锛岃繖閲屼繚瀛樹簡浣犳墍璁剧疆瀵嗙爜鐨凥ash鏁e垪鍊硷紝澶嶅埗杩欐"sha1:2190dj230dj......"锛堝叿浣撳唴瀹圭敱浣犵殑瀵嗙爜鍐冲畾锛夛紝鎺ョ潃鎵撳紑璇ユ枃浠跺す涓嬬殑鈥?span>jupyter_notebook_config.py鈥濓紝閫氳繃VSCode鐨勬煡鎵惧姛鑳芥壘鍒版墍绀哄紑澶村唴瀹瑰苟鏇挎崲鎴愪互涓嬪唴瀹癸細锛堣寰楁妸涓嬫柟鍛戒护鍓嶇殑 # 鍒犳帀鍝︹殸锛?/span>

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>

鐧婚檰浜戞湇鍔″櫒鐨勭綉椤垫帶鍒跺彴鐣岄潰锛岀偣閫変綘鐨勪簯鏈嶅姟鍣紝璺宠浆鍒版瑙堥〉闈紝鐐瑰嚮銆愬畨鍏ㄧ粍銆戞爣绛撅細

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=閫夋嫨銆愬叆鏂瑰悜瑙勫垯銆戯紝娣诲姞9999绔彛瑙勫垯锛屽叾浠栧唴瀹逛繚鎸侀粯璁わ紝纭畾鍗冲彲锛?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></p> 
<section class= 鏈€鍚庢垜浠皾璇曚竴涓嬪湪浜戞湇鍔″櫒涓婂惎鍔↗upyter Notebook鏈嶅姟锛屽湪杩滅▼缁堢杈撳叆浠ヤ笅鍛戒护锛?/span>

jupyter notebook --allow-root
濡傛灉缁堢鏄剧ず濡備笅锛屽垯璇佹槑鍚姩鎴愬姛锛?/span>
浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<section class= 鍙互鐪嬪埌Jupyter Notebook鏈嶅姟鍣ㄥ凡缁忓紑鍚苟鐩戝惉9999绔彛锛屾垜浠幇鍦ㄥ氨鍙互鐢ㄤ换鎰忕數鑴戙€佹墜鏈恒€佸钩鏉胯闂畠锛屾墦寮€娴忚鍣紝杈撳叆鍦板潃锛?/span>https:// + 浣犵殑浜戞湇鍔″櫒IP + 锛?999锛?/span> 锛堝洜涓轰娇鐢ㄤ簡SSL鍔犲瘑浼犺緭锛屽埆蹇樹簡https鍓嶇紑鍜屾渶鍚庡啋鍙?绔彛鍙凤紝鍦板潃搴斾负 https://120.110.119.114:9999 褰㈠紡锛?/span>
馃挕馃挕馃挕杩欓噷鏈変竴鐐归渶瑕佹敞鎰忥紝鍥犱负鎴戜滑鐢∣penSSL鐢熸垚鐨勮嚜绛惧悕璇佷功娌℃湁缁忔満鏋勮璇侊紝鎵€浠ラ娆$櫥闄嗘椂锛屾祻瑙堝櫒浼氭彁绀鸿瘉涔︿笉瀹夊叏锛屼絾鍏跺疄骞?span>涓嶅奖鍝嶅疄闄呭姞瀵嗘晥鏋?/strong>锛?/span>
浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<section class= 寰蒋Edge娴忚鍣ㄥ拰璋锋瓕Chrome娴忚鍣ㄦ彁绀?/span>
鐐瑰嚮鈥?span>璇︾粏淇℃伅鈥濇垨鈥?span>楂樼骇鈥濅腑鐨勩€愮户缁墠寰€/璁块棶銆戝嵆鍙垚鍔熻繘鍏ユ垜浠殑浜戠鏁版嵁瀹為獙瀹や簡锛?/span>
浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<section class= 鍦ㄩ噷闈㈠皾璇曠紪鍐橮ython浠g爜骞惰繍琛岋紝鎰熷彈涓€涓嬪拰鍦ㄨ嚜宸辩數鑴戣繍琛屾湁浠€涔堝樊鍒€?/span>

6銆佽Jupyter Notebook鍙樻垚寮€鏈鸿嚜鍚姩鏈嶅姟
浠ヤ笂鍏跺疄閮芥槸娴嬭瘯杩愯锛屽洜涓哄綋浣犵殑SSH杩炴帴鏂紑鍚庯紝浣犵殑Notebook鏈嶅姟涔熶細鑷姩缁堟浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=璇村ソ鐨勩€愰殢鏃堕殢鍦般€戝憿锛?/span>
浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></span></span> 
</section> 
<section class= 濡傛灉瑕佷綘鐨凬otebook杈惧埌鍍忕綉绔欎竴鏍?4灏忔椂鍙闂紝鎴戜滑杩橀渶瑕佹妸Jupyter Notebook 鍙樻垚鑷惎鍔ㄧ殑鍚庡彴鏈嶅姟锛岃浜戞湇鍔″櫒涓€鐩翠繚鎸佽繍琛屾墠琛屻€?/span>
棣栧厛纭繚浣犵殑浜戞湇鍔″櫒绯荤粺鐗堟湰涓嶅お鏃э紙鍥犱负鎺ヤ笅鏉ョ殑鏂规硶閫傜敤浜庢柊鐨?span>Systemd鏈哄埗锛屼笉閫傜敤鑰佺増鏈郴缁熺殑initd鍚姩鏈哄埗锛夛紝浣跨敤SSH杩炴帴鑷充簯鏈嶅姟鍣紝杈撳叆鍛戒护锛?/span>
cp /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service
鎺ョ潃杈撳叆 nano /etc/systemd/system/rc-local.service  鏉ュ湪缁堢浣跨敤鏂囨湰缂栬緫鍣?/span>缂栬緫鑴氭湰锛堟垨鑰呭鏋滄兂鐩磋鎿嶄綔锛屽氨浣跨敤VSCode缂栬緫璺緞  /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>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=鎺ヤ笅鏉ヨ緭鍏ヤ互涓嬪懡浠ゅ垱寤鸿繍琛屾棩蹇楁枃浠跺す鍙婅嚜鍚姩鑴氭湰锛氾紙鑻ョ敤VSCode锛屽垯鍦?etc鏂囦欢澶逛笅鏂板缓rc.local鏂囦欢锛?/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>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?> 
</section> 
<p class=闀胯垝鍙f皵~~~涓鸿嚜宸遍紦涓帉浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=鑳借窡鐫€鍋氬埌杩欓噷锛屽緢涓嶅鏄?img src="/img?url=https://res.wx.qq.com/mpres/htmledition/images/icon/common/emotion_panel/smiley/smiley_79.png" data-ratio="1" data-w="20" _width="20px" alt="浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class="mq-447">浣犲凡缁忓浼氫簡Linux鍩烘湰鎿嶄綔銆佺畝鍗曠殑杩愮淮鎿嶄綔銆佹惌寤虹畝鏄撴湇鍔″櫒绛夌瓑鎶€鑳?/span>銆?/span>

浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></span></p> 
<p class=鐜板湪浣犲凡缁忔嫢鏈変簡24灏忔椂鈽€馃寵鍏ㄥぉ鍊欑殑浜戞暟鎹疄楠屽锛岀湡姝g殑Anytime & Anywhere锛岃刀蹇€氳繃娴忚鍣ㄨ闂湅鐪嬪惂~


浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹?></span> 
</section> 
<section class= 鏈瘒鏄繖涓郴鍒楅噷鐩墠闅惧害鏈€澶х殑鏂囩珷浜嗭紝鑳界湅鍒拌繖閲岀殑灏忎紮浼村簲璇ュ瀵ユ棤鍑犱簡 浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class= 澶у鍦ㄤ笂杩版搷浣滆繃绋嬭偗瀹氫細閬囧埌璁稿闂锛屾杩庡湪鍏紬鍙峰唴鍜屾垜鐣欒█浜ゆ祦浜戣绠楀疄鎴樼瘒锛堜笁锛夆€斺€旀墦閫犻殢韬簯鏁版嵁瀹為獙瀹? class=涓嬩竴绡囩殑閫夐鎴戞鍦ㄩ厺閰匡紝鐩墠鏈変袱涓€欓€夛細
  1. 鍥犱负鎴戠粡甯镐娇鐢˙lender鍋?D锛屾€庢牱璁╀簯鏈嶅姟鍣ㄦ垚涓烘垜鐨?4灏忔椂娓叉煋涓绘満锛屼换鍔充换鎬ㄤ负鎴戞覆鏌?D椤圭洰锛?/span>

娆㈣繋瀵逛簯璁$畻鎰熷叴瓒g殑灏忎紮浼存姇绁ㄥ喅瀹氬悗鏈熺殑鍐呭锛?br>


鍙傝€冭祫鏂?/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

6銆?span class="mq-508">Jupyter瀹樻柟缃戠珯鍦ㄧ嚎璇曠敤鍦板潃
https://jupyter.org/try
7銆侀樋閲屼簯澶╂睜瀹為獙瀹ゅ厤璐笿upyter Notebook鍦板潃
https://tianchi.aliyun.com/notebook-ai
8銆佹竻鍗庡ぇ瀛﹀紑婧愰暅鍍忕珯
https://mirrors.tuna.tsinghua.edu.cn
9銆佸崕涓哄紑婧愰暅鍍忕珯
https://mirrors.huaweicloud.com/
10銆乁buntu 閫氳繃Systemd璁剧疆寮€鏈哄惎鍔ㄨ剼鏈?br>
https://www.jianshu.com/p/79d24b4af4e5
11銆乶ohup鍚庡彴杩愯銆丩inux閲嶅畾鍚戜粙缁?br>
https://www.cnblogs.com/IvyWong/p/9786226.html



鑻ヨ寰楁湁鎵€鏀惰幏锛岃鐐逛釜銆愬湪鐪嬨€?/strong>鈫?/span>鍝?/span>

以上是关于的主要内容,如果未能解决你的问题,请参考以下文章

谷歌浏览器调试jsp 引入代码片段,如何调试代码片段中的js

片段和活动之间的核心区别是啥?哪些代码可以写成片段?

VSCode自定义代码片段——.vue文件的模板

VSCode自定义代码片段6——CSS选择器

VSCode自定义代码片段——声明函数

VSCode自定义代码片段8——声明函数

(c)2006-2024 SYSTEM All Rights Reserved IT常识