Win11加wsl2安装anaconda

在Windows11中安装WSL2(Ubuntu20.04)并配置Anaconda环境 - 知乎 (zhihu.com)

使用的这篇帖子

wsl2如何安装pip

Windows下安装WSL2并配置Cuda、Miniconda和 Torch

Windows下安装WSL2并配置Cuda、Miniconda和 Torch - 知乎 (zhihu.com)

有一个坑VSCode怎么关闭自动更新,

vscode1.86以后不支持ubuntu18了所以不要先更新

VSCode怎么关闭自动更新 - 知乎 (zhihu.com)

wsl2 安装miniconda后conda:command not found

原因是Linux添加环境变量

wsl2 安装miniconda后conda:command not found_wsl conda: command not found-CSDN博客

wsl安装anaconda - 知乎 (zhihu.com)

添加环境变量,刷新环境变量

export PATH=/mnt/d/wsl2store/miniconda/bin:$PATH

source /etc/profile

怎么重启wsl

使用正确的命令重启WSL子系统_wsl 重启-CSDN博客

wsl --shotdown

Failed to save 'profile': Unable to write file 'vscode-remote://wsl+ubuntu-18.04/etc/profile' (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/etc/profile')

变成root用户,或者该权限

创建新的环境失败。

Channels:
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): \ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Read timed out. (read timeout=9.15)")': /pkgs/main/linux-64/repodata.json

/ Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f627e392f50>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /pkgs/main/linux-64/repodata.json

\ Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Read timed out. (read timeout=60.0)")': /pkgs/main/linux-64/repodata.json

failed

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

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://repo.anaconda.com blocked, please file
a support request with your network engineering team.

'https//repo.anaconda.com/pkgs/main/linux-64'

换源

Windows下2022年亲测好用的Conda国内镜像源_anaconda国内源哪个最好用-CSDN博客

Anaconda .condarc文件的位置 - 知乎 (zhihu.com)

换完不管用,

还是卸载重新安装在C盘吧

wsl如何卸载miniconda

Linux上删除Anaconda或Miniconda的步骤_linux 删除anaconda-CSDN博客

这个好用

找不到.zshrc

使用Windows10开发环境搭建(4) | 给WSL配置漂亮且强大的zsh_哔哩哔哩_bilibili

# >>> conda init >>>
   # !! Contents within this block are managed by 'conda init' !!
   __conda_setup="$(CONDA_REPORT_ERRORS=false '/home/yangpeng/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
   if [ $? -eq 0 ]; then
       \eval "$__conda_setup"
   else
       if [ -f "/home/yangpeng/anaconda3/etc/profile.d/conda.sh" ]; then
           . "/home/yangpeng/anaconda3/etc/profile.d/conda.sh"
           CONDA_CHANGEPS1=false conda activate base
       else
           \export PATH="/home/yangpeng/anaconda3/bin:$PATH"
       fi
   fi
   unset __conda_setup
   # <<< conda init <<<

wsl安装anaconda - 知乎 (zhihu.com)

由于安装的问题,使得只用 root用户可以用conda。

进root,再开启zsh可以使用,这样base环境也不显示了,真操蛋

这样每次进都是用户,然后不能conda,需要进root才能conda,

进root默认开启了conda,的base环境,然后想尽zsh需要再输入zsh

如何退出zsh

 exec bash  

 pip换源

conda换国内源&pip换国内源 - 知乎 (zhihu.com)

DeepLn | 智慧算力触手可及

Writing to /root/.config/pip/pip.conf

linux下快速查找文件

linux下快速查找文件_linux查找文件-CSDN博客

pip  install默认安装在哪里呀?

pip 换源

apt也需要换源

暂时先不换

  • 27
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值