conda更換清華源

1、概覽

? ? ? ? anaconda更換速度更快、更穩定的下載源,在linux環境測試通過。

2、conda源查看

? ? ? ? 在修改之前可以查看下現有conda源是什么,查看conda配置信息,如下:

cat ~/.condarc

????????可以看到你的conda源,以我的conda源舉例:

show_channel_urls: true
channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- defaults

? ? ? ? 其中,show_channel_urls表示下載時展示下載通道,channels中每項表示目前已配置的conda源(上述示例為清華源)。最后的defaults表示conda默認的官方源,如果嘗試前5個源失敗后,則會繼續嘗試在官方源下載,如果網速可以,defaults可以保留,反之建議刪除defaults(可以vim ~/.condarc 進行修改

????????如果你創建虛擬環境出現如下內容,則建議刪除defaults

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json>

3、conda清華源配置

? ? ? ? 配置前可通過如下命令清除原conda源

conda config --remove-key channels

? ? ? ? 清除后可以通過cat ~/.condarc 查看一下源,確保清除成功。

? ? ? ? 然后執行如下命令添加conda源:

conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

? ? ? ? 將上述命令復制到終端即可,運行無結果輸出,無報錯。然后查看condarc就可以看到conda源均被更新為如下樣式,注:確保5個鏈接均添加,否則會出現找不到包

show_channel_urls: true
channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

? ? ? ? 然后我們創建虛擬環境試一下,conda create -n py310 python=3.10.0 ,可以看到虛擬環境可正確創建,同時如果看到內容(Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.),表示conda在通過每個conda源拉取包創建虛擬環境,輸出如下:

Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done## Package Plan ##environment location: /user/.conda/envs/py310added / updated specs:- python=3.10.0The following packages will be downloaded:package                    |            build---------------------------|-----------------_libgcc_mutex-0.1          |             main           3 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main_openmp_mutex-5.1          |            1_gnu          21 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainbzip2-1.0.8                |       h5eee18b_6         262 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainca-certificates-2025.2.25  |       h06a4308_0         129 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainld_impl_linux-64-2.40      |       h12ee557_0         710 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainlibffi-3.3                 |       he6710b0_2          50 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainlibgcc-ng-11.2.0           |       h1234567_1         5.3 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainlibgomp-11.2.0             |       h1234567_1         474 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainlibstdcxx-ng-11.2.0        |       h1234567_1         4.7 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainlibuuid-1.0.3              |                0          32 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/freencurses-6.4                |       h6a678d5_0         914 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainopenssl-1.1.1w             |       h7f8727e_0         3.7 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpip-25.1                   |     pyhc872135_2         1.3 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpython-3.10.0              |       h12debd9_5        23.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainreadline-8.2               |       h5eee18b_0         357 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainsetuptools-78.1.1          |  py310h06a4308_0         1.7 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainsqlite-3.38.2              |       hc218d9a_0         1.0 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/maintk-8.6.11                  |       h1ccaba5_0         3.0 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/maintzdata-2025b               |       h04d1e81_0         116 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainwheel-0.45.1               |  py310h06a4308_0         115 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainxz-5.6.4                   |       h5eee18b_1         567 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainzlib-1.2.11                |                0         109 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free------------------------------------------------------------Total:        48.0 MBThe following NEW packages will be INSTALLED:_libgcc_mutex      anaconda/pkgs/main/linux-64::_libgcc_mutex-0.1-main _openmp_mutex      anaconda/pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu bzip2              anaconda/pkgs/main/linux-64::bzip2-1.0.8-h5eee18b_6 ca-certificates    anaconda/pkgs/main/linux-64::ca-certificates-2025.2.25-h06a4308_0 ld_impl_linux-64   anaconda/pkgs/main/linux-64::ld_impl_linux-64-2.40-h12ee557_0 libffi             anaconda/pkgs/main/linux-64::libffi-3.3-he6710b0_2 libgcc-ng          anaconda/pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1 libgomp            anaconda/pkgs/main/linux-64::libgomp-11.2.0-h1234567_1 libstdcxx-ng       anaconda/pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1 libuuid            anaconda/pkgs/free/linux-64::libuuid-1.0.3-0 ncurses            anaconda/pkgs/main/linux-64::ncurses-6.4-h6a678d5_0 openssl            anaconda/pkgs/main/linux-64::openssl-1.1.1w-h7f8727e_0 pip                anaconda/pkgs/main/noarch::pip-25.1-pyhc872135_2 python             anaconda/pkgs/main/linux-64::python-3.10.0-h12debd9_5 readline           anaconda/pkgs/main/linux-64::readline-8.2-h5eee18b_0 setuptools         anaconda/pkgs/main/linux-64::setuptools-78.1.1-py310h06a4308_0 sqlite             anaconda/pkgs/main/linux-64::sqlite-3.38.2-hc218d9a_0 tk                 anaconda/pkgs/main/linux-64::tk-8.6.11-h1ccaba5_0 tzdata             anaconda/pkgs/main/noarch::tzdata-2025b-h04d1e81_0 wheel              anaconda/pkgs/main/linux-64::wheel-0.45.1-py310h06a4308_0 xz                 anaconda/pkgs/main/linux-64::xz-5.6.4-h5eee18b_1 zlib               anaconda/pkgs/free/linux-64::zlib-1.2.11-0 Proceed ([y]/n)? y

各位如換源有問題可以留言交流!

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/80592.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/80592.shtml
英文地址,請注明出處:http://en.pswp.cn/web/80592.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Docker配置容器開機自啟或服務重啟后自啟

要將一個 Docker 容器設置為開機自啟&#xff0c;你可以使用 docker update 命令或配置 Docker 服務來實現。以下是兩種常見的方法&#xff1a; 方法 1&#xff1a;使用 docker update 設置容器自動重啟 使用 docker update 設置容器為開機自啟 你可以使用以下命令&#xff0c…

Flink 的水印機制

Apache Flink 的 水印機制&#xff08;Watermark Mechanism&#xff09; 主要用于解決 事件時間流中的亂序問題&#xff08;Out-of-Order Events&#xff09;&#xff0c;確保窗口&#xff08;Window&#xff09;能夠在合適的時間觸發計算&#xff0c;從而提供準確、一致的處理…

【每天一個知識點】embedding與representation

“Embedding&#xff08;嵌入&#xff09;”與“Representation&#xff08;表示&#xff09;”在機器學習、自然語言處理&#xff08;NLP&#xff09;、圖神經網絡等領域常被使用&#xff0c;它們密切相關&#xff0c;但語義上有一定區別。 一、定義 1. Representation&#…

SpringBoot(二)--- SpringBoot基礎(http協議、分層解耦)

目錄 前言 一、SpringBoot入門 1.入門程序 2.解析 二、HTTP協議 1.HTTP概述 2.HTTP請求協議 2.1 GET方式的請求協議 2.2 POST方式的請求協議 2.3 兩者的區別 2.4 獲取請求數據 3.HTTP響應協議 三、分層解耦 1.三層架構 2.IOC&DI 2.1 入門 2.2 IOC詳解 2.…

Please install it with pip install onnxruntime

無論怎么安裝都是 Please install it with pip install onnxruntime 我python 版本是3.11 &#xff0c;我換成3.10 解決了

【數據結構入門訓練DAY-35】棋盤問題

本次訓練聚焦于使用深度優先搜索&#xff08;DFS&#xff09;算法解決棋盤上的棋子擺放問題。題目要求在一個可能不規則的nn棋盤上擺放k個棋子&#xff0c;且任意兩個棋子不能位于同一行或同一列。輸入包括棋盤大小n和棋子數k&#xff0c;以及棋盤的形狀&#xff08;用#表示可放…

【日常筆記】wps如何將值轉換成東西南北等風向漢字

在WPS表格中&#xff0c;若要將數值&#xff08;如角度值&#xff09;轉換成“東、南、西、北”等風向漢字&#xff0c;可通過以下步驟結合自定義函數或條件判斷實現&#xff1a; 一、wps如何將值轉換 方法一&#xff1a;使用LOOKUP函數&#xff08;簡化公式&#xff09;&…

Web性能優化的未來:邊緣計算、AI與新型渲染架構

一、邊緣計算與性能優化深度整合 1.1 邊緣節點計算卸載策略 ? 智能任務分割:將非關鍵路徑計算卸載到邊緣節點 // 客戶端代碼 const edgeTask = new EdgeTask(image-processing); edgeTask.postMessage(imageData, {transfer

spring中的EnvironmentPostProcessor接口詳解

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到網站 EnvironmentPostProcessor 是 Spring Boot 提供的一個關鍵擴展接口&#xff0c;允許開發者在 Spring 應用環境初始化后、應用上下文創建前&…

Vue3知識點梳理

注&#xff1a;純手打&#xff0c;如有錯誤歡迎評論區交流&#xff01; 轉載請注明出處&#xff1a;https://blog.csdn.net/testleaf/article/details/148056625 編寫此文是為了更好地學習前端知識&#xff0c;如果損害了有關人的利益&#xff0c;請聯系刪除&#xff01; 本文章…

C++23 新增的查找算法詳解:ranges::find_last 系列函數

文章目錄 引言C Ranges 庫簡介ranges::find_last、ranges::find_last_if 和 ranges::find_last_if_not 概述ranges::find_last示例代碼代碼解釋 ranges::find_last_if函數簽名參數解釋示例代碼代碼解釋 ranges::find_last_if_not示例代碼代碼解釋 使用場景總結 引言 在 C 的發…

DW_DMAC簡介

基本概念&#xff1a; DMA&#xff1a;全稱direct memory access&#xff0c;即直接存儲器訪問。dma可以在中央處理器CPU不參與的情況下&#xff0c;實現外設和內存之間的數據直接傳輸&#xff0c;從而提高數據傳輸效率 外設與計算機內存之間的數據傳輸&#xff0c;一般可通過…

信號量基礎入門:并發控制的核心概念

問題的復雜性產生的根本原因在于&#xff0c;如 2.2 節所述&#xff0c;共享變量的訪問始終是“單向信息流”。也就是說&#xff0c;一個進程可以分配新值或檢查當前值&#xff0c;但這種檢查不會為其他進程留下任何痕跡。結果是&#xff0c;當一個進程想要對共享變量的當前值作…

(十九)Java集合框架深度解析:從基礎到高級應用

一、集合框架概述 1.1 什么是集合框架 Java集合框架(Java Collections Framework, JCF)是Java語言中用于表示和操作集合的一套標準化體系結構。它提供了一組接口、實現類和算法&#xff0c;用于存儲和操作對象組&#xff0c;解決了數組在存儲對象時的諸多限制。 集合框架的主…

Blender cycles烘焙貼圖筆記

下載了一些槍模型&#xff0c;一個模型有七八個材質&#xff0c;一個扳機、準星還有單獨的材質&#xff0c;用的貼圖只有一小部分有內容&#xff0c;對Draw Call非常不友好。不得不學一下怎么用Blender減材質。 找到了這個視頻如何在Blender中將多種材料多張貼圖烘焙成一張貼圖…

mysql的高可用

1. 環境準備 2臺MySQL服務器&#xff08;node1: 192.168.1.101&#xff0c;node2: 192.168.1.102&#xff09;2臺HAProxy Keepalived服務器&#xff08;haproxy1: 192.168.1.103&#xff0c;haproxy2: 192.168.1.104&#xff09;虛擬IP&#xff08;VIP: 192.168.1.100&#x…

鴻蒙 系統-安全-程序訪問控制-應用權限管控

Ability Kit 提供了一種允許應用訪問系統資源&#xff08;如&#xff1a;通訊錄等&#xff09;和系統能力&#xff08;如&#xff1a;訪問攝像頭、麥克風等&#xff09;的通用權限訪問方式&#xff0c;來保護系統數據&#xff08;包括用戶個人數據&#xff09;或功能&#xff0…

算法-數對的使用

1、數對可用于數組排序中&#xff0c;并且可記憶化排序前的元素下標 #include<iostream> #include<string> #include<bits/stdc.h> using namespace std; typedef long long ll; const int N 2e5 10; pair<int, int> a[N]; void solve() {ll n;cin …

Linux基礎第四天

系統之間文件共享 想要實現兩個不同的系統之間實現文件共享&#xff0c;最簡單的一種方案就是設置VMware軟件的共享文件夾&#xff0c;利用共享文件夾可以實現linux系統和windows系統之間的文件共享&#xff0c;這樣就可以實現在windows系統上編輯程序&#xff0c;然后在linux系…

Docker 核心原理詳解:Namespaces 與 Cgroups 如何實現資源隔離與限制

#Docker疑難雜癥解決指南# Docker 作為容器化技術的代名詞,徹底改變了軟件的開發、部署和管理方式。它憑借其輕量、快速、一致性強的特性,成為了現代云原生架構的基石。然而,Docker 容器的神奇之處并非“無中生有”,其背后是 Linux 內核的兩大核心技術——Namespaces(命名…