{"id":1635,"date":"2024-05-07T15:56:52","date_gmt":"2024-05-07T15:56:52","guid":{"rendered":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/?p=1635"},"modified":"2024-05-08T15:15:38","modified_gmt":"2024-05-08T15:15:38","slug":"%e5%ae%89%e8%a3%9danaconda%e7%b5%a6%e5%a4%a7%e5%ae%b6%e7%94%a8multi-user-anaconda-installation","status":"publish","type":"post","link":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/?p=1635","title":{"rendered":"\u5b89\u88ddAnaconda\u7d66\u5927\u5bb6\u7528(Multi-user Anaconda installation)"},"content":{"rendered":"\n<p>Ubuntu\u7684\u4f7f\u7528\u8005user01\u81ea\u5df1\u5b89\u88ddanaconda\u7684\u8a71\uff0c\u5b83\u6703\u88dd\u5230\/home\/user01\/anaconda3\u53bb\u3002\u4f46\u662f\u6211\u5011\u4e5f\u60f3\u8b93\u88e1\u9762\u5176\u4ed6\u5e33\u865f\u7684\u4f7f\u7528\u8005\u90fd\u80fd\u7528\uff0c\u600e\u9ebc\u505a\u5462\uff1f\u6211\u5011\u7684\u60f3\u6cd5\u662f\u5efa\u7acb\u4e00\u500b\u53eb\u505aanaconda\u7684\u7fa4\u7d44\uff0c\u7136\u5f8c\u8b93\u6240\u6709\u88ab\u52a0\u9032\u9019\u500b\u7fa4\u7d44\u7684\u4f7f\u7528\u8005\u5011(user01, user02, user03, etc.) \u90fd\u80fd\u5728\u9019\u53f0Linux\u4e0a\u4f7f\u7528anaconda\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u56e0\u70ba\u6211\u5011\u525b\u525b\u5df2\u7d93\u88dd\u4e86\u4e00\u500b\u53ea\u80fd\u7d66\u4f7f\u7528\u9019\u81ea\u5df1\u7528\u7684anaconda\uff0c\u6211\u5011\u5148\u89e3\u9664\u4f7f\u7528\u8005\u88dd\u7d66\u81ea\u5df1\u7684\u90a3\u500banaconda\u9084\u6709\u88e1\u9762\u4e0d\u8981\u7684canda\u74b0\u5883\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u522a\u9664\/home\/user01\/anaconda<br>rm -rf ~\/anaconda<\/li>\n\n\n\n<li>\u79fb\u9664\u4f7f\u7528\u8005 .bashrc \u8207 ~\/.conda\/environments.txt \u88e1\u9762\u7684\u76f8\u95dc\u7684\u74b0\u5883\u8a2d\u5b9a<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53d6\u5f97Anaconda<\/h2>\n\n\n\n<p>\u5230<a href=\"https:\/\/www.anaconda.com\">https:\/\/www.anaconda.com<\/a>\u4e0b\u8f09Anaconda installer for Linux (\u6211\u5011\u88dd\u7684\u662f64bit x86\u7248\u672c)\uff0c\u4e0b\u8f09\u4f86\u7684\u662f Anaconda3-2024.02-1-Linux-x86_64.sh<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/anaconda3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"744\" src=\"https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/anaconda3-1024x744.png\" alt=\"\" class=\"wp-image-1638\" srcset=\"https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/anaconda3-1024x744.png 1024w, https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/anaconda3-300x218.png 300w, https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/anaconda3-768x558.png 768w, https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/anaconda3-1536x1116.png 1536w, https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/anaconda3-2048x1488.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88ddanaconda3<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sh Anaconda3-2024.02-1-Linux-x86_64.sh<\/code><\/pre>\n\n\n\n<p>\u6307\u5b9a\u5b89\u88dd\u8def\u5f91\uff1a\/opt\/anaconda3<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/opt.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"313\" src=\"https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/opt-1024x313.png\" alt=\"\" class=\"wp-image-1639\" srcset=\"https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/opt-1024x313.png 1024w, https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/opt-300x92.png 300w, https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/opt-768x234.png 768w, https:\/\/megagenome.nchu.edu.tw\/wordpress\/wp-content\/uploads\/2024\/05\/opt.png 1458w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>\u88dd\u597d\u4e4b\u5f8c\uff0c\u6211\u5011\u7528groupadd\u6307\u4ee4\uff0c\u5275\u7acb\u4e00\u500b\u65b0\u7684\u7fa4\u7d44\uff0c\u540d\u7a31\u5c31\u53eb\u505aanaconda\u597d\u4e86\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo groupadd anaconda<\/code><\/pre>\n\n\n\n<p>\u628a\/opt\/anaconda\u5305\u542b\u88e1\u9762\u7684\u6771\u897f\u90fd\u958b\u653e\u7d66anaconda\u7fa4\u7d44\u4f7f\u7528\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chgrp -R anaconda \/opt\/anaconda3\nchmod 770 -R \/opt\/anaconda3<\/code><\/pre>\n\n\n\n<p>\u7528adduser\u6307\u4ee4\u628a\u4f7f\u7528\u8005\u52a0\u9032anaconda\u9019\u500b\u7fa4\u7d44\u4f86\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo adduser user01 anaconda\nsudo adduser user02 anaconda\n\u2026<\/code><\/pre>\n\n\n\n<p>\u5099\u8a3b\uff1a\u4f7f\u7528\u8005\u53ef\u4ee5\u540c\u6642\u96b8\u5c6c\u65bc\u597d\u5e7e\u500b\u4e0d\u540c\u7684\u7fa4\u7d44\uff0cgroupadd\u53ef\u4ee5\u5275\u7acb\u65b0\u7fa4\u7d44\uff0cgroupdel\u53ef\u4ee5\u522a\u9664\u7fa4\u7d44\u3002\u5982\u679c\u4f60\u8981\u628a\u4f7f\u7528\u8005user03\u8d95\u51faanaconda\u7fa4\u7d44\uff0c\u7528deluser\uff1a<br>sudo deluser user03 anaconda<\/p>\n\n\n\n<p>\u6700\u5f8c\uff0c\u4f7f\u7528\u8005\u5fc5\u9808\u5404\u81ea\u4fee\u6539\u4ed6\u7684\u74b0\u5883\u8a2d\u5b9a\uff0c\u624d\u80fd\u7528\u9019\u500b\u88dd\u5728opt\u5e95\u4e0b\u7684anaconda\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u7528source\u6307\u4ee4\u628aactivate\u9019\u500bscript\u88e1\u9762\u8a2d\u7f6eAnaconda\u7528\u7684\u74b0\u5883\u8b8a\u6578\u8a2d\u7f6e\u5230\u4f7f\u7528\u8005\u73fe\u5728\u7684shell<\/p>\n\n\n\n<p>\u7136\u5f8c\u6253conda init\u4f86\u521d\u59cb\u5316conda\u74b0\u5883\uff0c\u5b83\u7684\u7528\u8655\u662f\u4fee\u6539\u4f7f\u7528\u8005\u7684shell\u914d\u7f6e\u6587\u4ef6\uff08\u9019\u88e1\u662f.bashrc)\uff0c\u4ee5\u4fbf\u6bcf\u6b21\u555f\u52d5shell\u6642\u90fd\u81ea\u52d5\u521d\u59cb\u5316conda\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source \/opt\/anaconda3\/bin\/activate\nconda init<\/code><\/pre>\n\n\n\n<p>\u9019\u6703\u4fee\u6539\u4f7f\u7528\u8005\u81ea\u5df1\u7684~\/.bashrc \u5728\u88e1\u9762\u589e\u52a0\u9019\u6a23\u7684\u5167\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-9f0ee7def19cbdbdbc083ab613bae2a5\"><code># &gt;&gt;&gt; conda initialize &gt;&gt;&gt;\n# !! Contents within this block are managed by 'conda init' !!\n__conda_setup=\"$('\/opt\/anaconda3\/bin\/conda' 'shell.bash' 'hook' 2&gt; \/dev\/null)\"\nif &#91; $? -eq 0 ]; then\n    eval \"$__conda_setup\"\nelse\n    if &#91; -f \"\/opt\/anaconda3\/etc\/profile.d\/conda.sh\" ]; then\n        . \"\/opt\/anaconda3\/etc\/profile.d\/conda.sh\"\n    else\n        export PATH=\"\/opt\/anaconda3\/bin:$PATH\"\n    fi\nfi\nunset __conda_setup<\/code><\/pre>\n\n\n\n<p>\u4f7f\u7528\u8005\u5fc5\u9808\u767b\u51fa\u518d\u767b\u5165\uff0c\u4ee5\u4e0a\u4e00\u4e9b\u8a2d\u5b9a\u624d\u6703\u751f\u6548\u5594\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu\u7684\u4f7f\u7528\u8005user01\u81ea\u5df1\u5b89\u88ddanaconda\u7684\u8a71\uff0c\u5b83\u6703\u88dd\u5230\/home\/user01\/anaconda3\u53bb\u3002\u4f46\u662f\u6211\u5011\u4e5f\u60f3\u8b93\u88e1\u9762\u5176\u4ed6\u5e33\u865f\u7684\u4f7f\u7528\u8005\u90fd\u80fd\u7528\uff0c\u600e\u9ebc\u505a\u5462\uff1f\u6211\u5011\u7684\u60f3\u6cd5\u662f\u5efa\u7acb\u4e00\u500b\u53eb\u505aanaconda\u7684\u7fa4\u7d44\uff0c\u7136\u5f8c\u8b93\u6240\u6709\u88ab\u52a0\u9032\u9019\u500b\u7fa4\u7d44\u7684\u4f7f\u7528\u8005\u5011(user01, user02, user03, etc.) \u90fd\u80fd\u5728\u9019\u53f0Linux\u4e0a\u4f7f\u7528anaconda\u3002<\/p>\n","protected":false},"author":1,"featured_media":1699,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"no_sidebar_full_width","colormag_page_sidebar_layout":"no_sidebar","footnotes":""},"categories":[5],"tags":[18,28],"class_list":["post-1635","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-linux","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1635"}],"version-history":[{"count":6,"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1635\/revisions"}],"predecessor-version":[{"id":1707,"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1635\/revisions\/1707"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/1699"}],"wp:attachment":[{"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/megagenome.nchu.edu.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}