Miniconda安装及搭建
Miniconda安裝配置
下載Miniconda
Miniconda下載地址
最新版 Miniconda For Windows 下載鏈接
Windows 安裝配置
修改Powershell執行策略(Windows10+非家庭版需要操作)
在開始圖標右鍵單擊,選擇 Windows PowerShell(終端管理員)
先輸入下面的內容,并回車:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
出現如下內容后,輸入:A,回車:
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution
policy might expose you to the security risks described in the about Execution Policies help
topic at https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): -
最后在 Anaconda Powershell Prompt 中輸入:
conda init
Conda更換鏡像源
清華大學開源軟件鏡像站
在 Anaconda Powershell Prompt 中輸入:
conda config --set show_channel_urls yes
然后在 Anaconda Powershell Prompt 中輸入:
notepad .condarc # 注意有個小點 "." 在 "condarc" 的前面
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
粘貼上面在鏡像站復制的文本,保存文件后關閉
最后在 Anaconda Powershell Prompt 中輸入:
conda clean -i # 清除源緩存,以啟用鏡像源
PyPI更換鏡像源
校園網聯合鏡像站
# 設置 PyPI 鏡像源
pip config set global.index-url https://mirrors.cern
復制上述文本后,在 Anaconda Powershell Prompt 中粘貼運行即可。
課程環境搭建
創建與激活CONDA環境
conda環境創建: conda create -n p2s python=3.10
(-n代表創建的環境名稱,這里是p2s,并指定Python版本為3.10)
激活conda環境:conda activate p2s
刪除某個CONDA環境
退出該環境:conda deactivate
刪除整個環境:conda remove -n p2s --all
Pip安裝與展示
Pip安裝課程所需第三方庫:pip install jupyter
在指定文件夾輸入:jupyter lab(會自動跳轉到瀏覽器)
結束學習時:Ctrl + C (關閉Jupyter Notebook 服務)
總結
以上是生活随笔為你收集整理的Miniconda安装及搭建的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 雷军:小米高度重视年轻人培养 今年已招2
- 下一篇: 疫情之下的共享办公:行业经历了过山车后