-bash: /home/xxx/anaconda3/bin/conda: No such file or directory

Linux系统中移动用户的配置文件后,Anaconda出现-bash: /home/shaocaiyin2023/anaconda3/bin/conda: No such file or directory错误提示。

  1. 查看PATH变量信息
    echo $PATH
    检查环境变量是否包含移动之后的文件目录,主要到*/anaconda3/bin这一层。如果没有,请在~/.bashrc中加上一句:
powershell 复制代码
export PATH="newpath/anaconda3/bin:$PATH"
  1. 修改~/.bashrc中conda的相关的地址
powershell 复制代码
vim ~/.bashrc
powershell 复制代码
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/data/username/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/data/username/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/data/username/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/data/username/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<
  1. 修改conda内的变量,更新第一行的路径信息(#!/home/username/anaconda3/bin/python)
powershell 复制代码
vim ~/anaconda3/bin/pip
vim ~/anaconda3/bin/pip3
vim ~/anaconda3/bin/conda
  1. 更新每个虚拟环境中的pip路径,否则无法进行pip安装
powershell 复制代码
cd ~/anaconda3/envs/

vim envs_name/bin/pip
vim envs_name/bin/pip3
  1. 将当前用户主目录下的 .bashrc 文件中的配置立即应用到当前的shell会话中
powershell 复制代码
source ~/.bashrc
相关推荐
HideF4 小时前
Linux sudo
linux
FlightYe5 小时前
视界原理之3D视频(四):裸眼、眼镜和头显
android·linux·c++·3d·ffmpeg·音视频
蹊黎5 小时前
Linux 下用 C 语言实现进度条
linux·c语言·单片机
牛马鸡niumasi7 小时前
【Linux】C语言文件操作
linux
say_fall7 小时前
【Linux系统编程】Ext 文件系统:磁盘与存储、文件与目录、现代计算机究竟如何寻找文件
linux·运维·服务器·数据库·c++
wacsii8 小时前
【Linux进程(一)】Linux 进程初探:操作系统如何管理进程?fork() 为什么返回两次?
linux·运维·服务器
AI+程序员在路上8 小时前
RV1126B 上支持的模型及全流程应用--从CNN及语音到 LLMVLM 与跨平台选型
linux·c语言·人工智能
默|笙8 小时前
【Linux网络】传输层协议TCP(1)---TCP报文介绍
linux·网络·tcp/ip
相思难忘成疾8 小时前
从零搭建 Kubernetes 1.30 集群:kubeadm 部署一主多从实战(RHEL 9.3 + Docker + flannel)
linux·运维·kubernetes
用户4107192013258 小时前
用 systemd 从零做一个系统健康巡检服务:脚本、沙箱与磁盘满排查实战
linux·ubuntu