-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
相关推荐
Sumlll_7 小时前
Ubuntu系统下QEMU的安装与RISC-V的测试
linux·ubuntu·risc-v
猫头虎7 小时前
2025最新OpenEuler系统安装MySQL的详细教程
linux·服务器·数据库·sql·mysql·macos·openeuler
晚风吹人醒.8 小时前
SSH远程管理及访问控制
linux·运维·ssh·scp·xshell·访问控制·远程管理
Uncertainty!!10 小时前
Linux多用户情况下个别用户输入密码后黑屏
linux·远程连接
necessary65310 小时前
使用Clion查看linux环境中的PG源码
linux·运维·服务器
小猪佩奇TONY11 小时前
Linux 内核学习(14) --- linux x86-32 虚拟地址空间
linux·学习
Lam㊣11 小时前
Centos 7 系统docker:更换镜像源
linux·docker·centos
FL162386312912 小时前
win11+WSL+Ubuntu-xrdp+远程桌面闪退+黑屏闪退解决
linux·运维·ubuntu
石头53012 小时前
Kubernetes监控全栈解决方案:从零搭建Prometheus+Grafana监控体系
linux
ha204289419412 小时前
Linux操作系统学习记录之---TcpSocket
linux·网络·c++·学习