{"id":1515,"date":"2022-03-21T23:23:14","date_gmt":"2022-03-21T15:23:14","guid":{"rendered":"https:\/\/peloo.net\/?p=1515"},"modified":"2022-10-02T16:13:14","modified_gmt":"2022-10-02T08:13:14","slug":"ubuntu18-04%e5%ae%89%e8%a3%85anaconda","status":"publish","type":"post","link":"https:\/\/peloo.net\/?p=1515","title":{"rendered":"Ubuntu18.04\u5b89\u88c5Anaconda"},"content":{"rendered":"<h1>\u80cc\u666f<\/h1>\n<p>\u7ecf\u5e38\u4f1a\u7528\u5230Python\uff0c\u514d\u4e0d\u4e86\u642d\u5efa\u73af\u5883\uff0cpyenv\u786e\u5b9e\u5f88\u597d\u7528\uff0c\u4f46\u662f\u5728\u67d0\u4e9b\u5e73\u53f0\u4e0a\u5b89\u88c5\u5931\u8d25\uff0c\u6bd4\u5982\u6700\u8fd1\u5728linode\u4e3b\u673aubuntu18.04\u7cfb\u7edf\u4e0a\u5b89\u88c5\u65e0\u6cd5\u81ea\u52a8\u5b89\u88c5pip\uff0c\u4e8e\u662f\u5b89\u88c5Anaconda\u5c31\u6210\u4e86\u7ec8\u6781\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<h1>\u5b89\u88c5\u73af\u5883<\/h1>\n<p>ubuntu18.04 x86_64\u67b6\u6784<br \/>\nAnaconda\u76ee\u524d\uff082022.03.21\uff09\u6700\u65b0\u7248\u672c2021.11<\/p>\n<h1>\u5b89\u88c5\u8fc7\u7a0b<\/h1>\n<h2>\u4e0b\u8f7d\u6700\u65b0\u7248\u672cAnaconda<\/h2>\n<p>Anaconda\u5b98\u7f51\u4e0b\u8f7d\u5730\u5740<a href=\"https:\/\/www.anaconda.com\/products\/individual#Downloads\" title=\"\u4f20\u9001\u95e8\">\u4f20\u9001\u95e8<\/a><br \/>\ncd<br \/>\nwget -c --no-check-certificate <a href=\"https:\/\/repo.anaconda.com\/archive\/Anaconda3-2021.11-Linux-x86_64.sh\">https:\/\/repo.anaconda.com\/archive\/Anaconda3-2021.11-Linux-x86_64.sh<\/a><br \/>\n\u4e0b\u8f7d\u6162\u7684\u8bdd\u7528\u6e05\u534e\u6e90\u7684\u5730\u5740<br \/>\nwget -c --no-check-certificate <a href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/archive\/Anaconda3-2021.11-Linux-x86_64.sh\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/archive\/Anaconda3-2021.11-Linux-x86_64.sh<\/a><br \/>\nchmod 775 Anaconda3-2021.11-Linux-x86_64.sh<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/peloo.net\/wp-content\/uploads\/2022\/03\/anaconda_01.png\" alt=\"\" \/><\/p>\n<h2>\u5b89\u88c5Anaconda<\/h2>\n<p>\u8fd0\u884c\u4e0b\u8f7d\u597d\u7684sh\u811a\u672c<br \/>\nbash Anaconda3-2021.11-Linux-x86_64.sh<\/p>\n<h3>\u63a5\u53d7\u6761\u6b3e\u534f\u8bae<\/h3>\n<p>\u8f93\u5165yes<br \/>\n<img decoding=\"async\" src=\"https:\/\/peloo.net\/wp-content\/uploads\/2022\/03\/VeryCapture_20220322000535.jpg\" alt=\"\" \/><\/p>\n<h3>\u9ed8\u8ba4\u5b89\u88c5\u5728\u5bb6\u76ee\u5f55<\/h3>\n<p>\u56de\u8f66<br \/>\n<img decoding=\"async\" src=\"https:\/\/peloo.net\/wp-content\/uploads\/2022\/03\/VeryCapture_20220322000608.jpg\" alt=\"\" \/><br \/>\n\u63a5\u4e0b\u6765\u5c31\u662f\u51e0\u5206\u949f\u5de6\u53f3\u7684\u5b89\u88c5\u7b49\u5f85<\/p>\n<h3>\u521d\u59cb\u5316<\/h3>\n<p>\u5efa\u8bae\u9ed8\u8ba4\u914d\u7f6e<br \/>\n<img decoding=\"async\" src=\"https:\/\/peloo.net\/wp-content\/uploads\/2022\/03\/VeryCapture_20220322004033.jpg\" alt=\"\" \/><\/p>\n<h3>\u5b89\u88c5\u6210\u529f<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/peloo.net\/wp-content\/uploads\/2022\/03\/VeryCapture_20220322004102.jpg\" alt=\"\" \/><\/p>\n<h2>\u67e5\u770bconda\u914d\u7f6e<\/h2>\n<p>\u521d\u59cb\u5316\u7ec8\u7aef\uff0c\u4f1a\u51fa\u73b0\u201cbase\u201d\u5b57\u6837\uff0c\u8868\u793a\u5df2\u7ecf\u6210\u529f\u8fdb\u5165\u9ed8\u8ba4\u7684python3.9\u73af\u5883<br \/>\nexec bash<br \/>\nconda config --show<\/p>\n<h2>\u6dfb\u52a0\u6e05\u534e\u955c\u50cf\u6e90<\/h2>\n<p>conda config --add channels <a href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/pkgs\/free\/\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/pkgs\/free\/<\/a><br \/>\nconda config --add channels <a href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/pkgs\/main\/\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/pkgs\/main\/<\/a><br \/>\nconda config --set show_channel_urls yes<\/p>\n<h2>\u66f4\u65b0Anaconda<\/h2>\n<p>conda upgrade --all -y<br \/>\n<img decoding=\"async\" src=\"https:\/\/peloo.net\/wp-content\/uploads\/2022\/03\/VeryCapture_20220322004633.jpg\" alt=\"\" \/><\/p>\n<h2>\u914d\u7f6epip\u56fd\u5185\u6e90\uff08\u5982\u679c\u9700\u8981\uff09<\/h2>\n<p>pip config set global.index-url <a href=\"https:\/\/pypi.tuna.tsinghua.edu.cn\/simple\">https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/a><\/p>\n<h2>\u5b89\u88c5\u4e00\u4e9b\u5e38\u7528\u5e93\uff08\u5982\u679c\u9700\u8981\uff09<\/h2>\n<p>pip install --upgrade pip<br \/>\npip install requests mysqlpy paramiko ipython numpy scipy opencv-python sanic sanic_cors<\/p>\n<h1>Anaconda\u4f7f\u7528<\/h1>\n<h2>\u67e5\u770b\u73af\u5883<\/h2>\n<p>conda env list<\/p>\n<h2>\u521b\u5efa\u73af\u5883<\/h2>\n<p>conda create -n py3813 python=3.8.13 -y<\/p>\n<h2>\u6fc0\u6d3b\u73af\u5883<\/h2>\n<p>conda activate py3813<br \/>\n\u6bcf\u4e2a\u73af\u5883\u90fd\u662f\u72ec\u7acb\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u5b89\u88c5\u6240\u9700\u7684\u8f6f\u4ef6\u5305<\/p>\n<h2>\u8bbe\u7f6e\u7528\u6237\u767b\u5f55\u9ed8\u8ba4\u7684python\u73af\u5883<\/h2>\n<p>\u4fee\u6539~\/.bashrc\uff0c\u672b\u5c3e\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff0c\u4f8b\u5b50\u662f\u6dfb\u52a0py385\u73af\u5883<br \/>\nconda activate py3813<\/p>\n<h2>\u9000\u51fa\u73af\u5883<\/h2>\n<p>conda deactivate<\/p>\n<h2>\u5220\u9664\u73af\u5883<\/h2>\n<p>conda remove -n env_name --all<\/p>\n<h2>\u5220\u9664\u5355\u4e2a\u955c\u50cfURL<\/h2>\n<p>conda config --remove channels your_url #\u4f60\u60f3\u79fb\u9664\u7684\u6307\u5b9a\u955c\u50cf\u8def\u5f84<\/p>\n<h2>\u6062\u590d\u9ed8\u8ba4\u7684\u955c\u50cf\u6e90<\/h2>\n<p>conda config --remove-key channels<\/p>\n<h2>conda\u641c\u7d22\u5305<\/h2>\n<p>conda search python | grep 3.8.13<\/p>\n<h1>\u5e38\u89c1\u95ee\u9898FAQ<\/h1>\n<h2>\u610f\u5916\u4e2d\u65ad\u540e\u91cd\u65b0\u5b89\u88c5\uff08\u5982\u679c\u9700\u8981\uff09<\/h2>\n<p>\u52a0\u4e0a-u\u53c2\u6570\u5373\u53ef<br \/>\nbash Anaconda3-2021.11-Linux-x86_64.sh -u<\/p>\n<h2>\u5378\u8f7dAnaconda\uff08\u5982\u679c\u9700\u8981\uff09<\/h2>\n<h3>\u5220\u9664.bashrc\u91cc\u7684\u914d\u7f6e<\/h3>\n<p>vim ~\/.bashrc<br \/>\n\u5220\u9664\u4ee5\u4e0b\u90e8\u5206\uff0c<br \/>\n<img decoding=\"async\" src=\"https:\/\/peloo.net\/wp-content\/uploads\/2022\/03\/VeryCapture_20220322004857.jpg\" alt=\"\" \/><\/p>\n<h3>\u5220\u9664anaconda3\u6587\u4ef6\u5939<\/h3>\n<p>rm -rf ~\/anaconda3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f \u7ecf\u5e38\u4f1a\u7528\u5230Python\uff0c\u514d\u4e0d\u4e86\u642d\u5efa\u73af\u5883\uff0cpyenv\u786e\u5b9e\u5f88\u597d\u7528\uff0c\u4f46\u662f\u5728\u67d0\u4e9b\u5e73\u53f0\u4e0a\u5b89\u88c5\u5931\u8d25\uff0c\u6bd4\u5982\u6700\u8fd1\u5728linode\u4e3b\u673aubuntu18.04\u7cfb\u7edf\u4e0a\u5b89\u88c5\u65e0\u6cd5\u81ea\u52a8\u5b89\u88c5pip\uff0c\u4e8e\u662f\u5b89\u88c5Anaconda\u5c31\u6210\u4e86\u7ec8\u6781\u89e3\u51b3\u65b9\u6848\u3002 \u5b89\u88c5\u73af\u5883 ubuntu18.04 x86_64\u67b6\u6784 Anaconda\u76ee\u524d\uff082022.03.21\uff09\u6700\u65b0\u7248\u672c2021.11 \u5b89\u88c5\u8fc7\u7a0b \u4e0b\u8f7d\u6700\u65b0\u7248\u672cAnaconda Anaconda\u5b98\u7f51\u4e0b\u8f7d\u5730\u5740\u4f20\u9001\u95e8 cd wget -c &#8211;no-check-certificate https:\/\/repo.anaconda.com\/archive\/Anaconda3-2021.11-Linux-x86_64.sh \u4e0b\u8f7d\u6162\u7684\u8bdd\u7528\u6e05\u534e\u6e90\u7684\u5730\u5740 wget -c &#8211;no-check-certificate https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/archive\/Anaconda3-2021.11-Linux-x86_64.sh chmod 775 Anaconda3-2021.11-Linux-x86_64.sh \u5b89\u88c5Anaconda \u8fd0\u884c\u4e0b\u8f7d\u597d\u7684sh\u811a\u672c bash Anaconda3-2021.11-Linux-x86_64.sh \u63a5\u53d7\u6761\u6b3e\u534f\u8bae \u8f93\u5165yes \u9ed8\u8ba4\u5b89\u88c5\u5728\u5bb6\u76ee\u5f55 \u56de\u8f66 \u63a5\u4e0b\u6765\u5c31\u662f\u51e0\u5206\u949f\u5de6\u53f3\u7684\u5b89\u88c5\u7b49\u5f85 \u521d\u59cb\u5316 \u5efa\u8bae\u9ed8\u8ba4\u914d\u7f6e \u5b89\u88c5\u6210\u529f \u67e5\u770bconda\u914d\u7f6e \u521d\u59cb\u5316\u7ec8\u7aef\uff0c\u4f1a\u51fa\u73b0\u201cbase\u201d\u5b57\u6837\uff0c\u8868\u793a\u5df2\u7ecf\u6210\u529f\u8fdb\u5165\u9ed8\u8ba4\u7684python3.9\u73af\u5883 exec bash conda config &#8211;show \u6dfb\u52a0\u6e05\u534e\u955c\u50cf\u6e90 conda config &#8211;add channels https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/pkgs\/free\/ conda config &#8211;add channels https:\/\/mirrors.tuna.tsinghua.edu.cn\/anaconda\/pkgs\/main\/ conda config &#8211;set&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,10],"tags":[],"class_list":["post-1515","post","type-post","status-publish","format-standard","hentry","category-env","category-python"],"aioseo_notices":[],"brizy_media":[],"_links":{"self":[{"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/posts\/1515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/peloo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1515"}],"version-history":[{"count":20,"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/posts\/1515\/revisions"}],"predecessor-version":[{"id":1561,"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/posts\/1515\/revisions\/1561"}],"wp:attachment":[{"href":"https:\/\/peloo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peloo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peloo.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}