【anaconda】激活环境失败-bash: activate:No such file/没有那个文件或目录

anaconda通常用于创建python虚拟环境,但环境变量有误时会出现无法激活的情况

在这里插入图片描述

1.添加环境变量
#出现这一问题的主要原因在于bash在环境变量中找不到activate这个命令了
#所以需要将环境变量写入
#环境变量一般在两个位置~/.bashrc和/etc/bash.bashrc  bash的设置
#~/.profile  /etc/profile  系统设置
#最方便的做法是export
export PATH="~/anaconda3/bin:$PATH"   #将PATH添加即可
source activate YourEnvs
2.conda activate

conda自带的activate命令可以直接调用conda下的环境路径,所以在无法用source激活时,可以选择:
conda activate YourEnvs
来激活python虚拟环境。

https://unsplash.com/photos/bW2vHKCxbx4
pic from unsplash


ref:
https://blog.csdn.net/xiangyong58/article/details/73650105
https://jingyan.baidu.com/article/cd4c297936a220756e6e60df.html
conda:
https://www.anaconda.com/
https://conda.io/miniconda.html
https://cloud.tencent.com/developer/article/1351778

(.venv) C:\Users\25487>pip install -r requirements.txt [notice] A new release of pip is available: 24.3.1 -> 25.0.1 [notice] To update, run: python.exe -m pip install --upgrade pip ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt' (.venv) C:\Users\25487> (.venv) C:\Users\25487>conda create -n open_manus python=3.12 'conda' 不是内部外部命令,也不是可运行的程序 批处理文件。 (.venv) C:\Users\25487>cd /path/to/your/project 系统找不到指定的路径。 (.venv) C:\Users\25487>pip install -r /absolute/path/to/requirements.txt [notice] A new release of pip is available: 24.3.1 -> 25.0.1 [notice] To update, run: python.exe -m pip install --upgrade pip ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/absolute/path/to/requirements.txt' (.venv) C:\Users\25487> (.venv) C:\Users\25487>dir 驱动器 C 中的卷是 OS 卷的序列号是 12EA-6BA7 C:\Users\25487 的目录 2025/03/21 14:07 <DIR> . 2024/09/15 10:53 <DIR> .. 2025/03/18 13:30 <DIR> .anaconda 2020/08/11 17:56 <DIR> .android 2025/03/21 12:53 <DIR> .conda 2025/03/18 13:30 146 .condarc 2025/03/18 13:30 <DIR> .continuum 2025/03/19 16:16 <DIR> .lmstudio 2025/02/06 15:32 24 .lmstudio-home-pointer 2022/09/07 19:47 <DIR> .NEMU 2025/03/20 17:47 <DIR> .ollama 2025/03/21 10:52 <DIR> .trae-cn 2025/03/21 14:07 <DIR> .venv 2025/03/20 10:24 <DIR> .vscode 2025/03/21 13:21 0 25.0.1 2021/04/03 10:25 <DIR> 3D Objects 2025/03/21 14:10 <DIR> anaconda3 2025/03/21 11:22 <DIR> ANACON~ 2025/03/21 10:56 0 argparse.Namespace 2022/02/20 16:09 <DIR> Autodesk 2021/08/18 10:12 131 BullseyeCoverageError.txt 2024/09/15 11:00 <DIR> Contacts 2025/03/21 11:12 <DIR> Desktop 2025/03/20 11:04 <DIR> Documents 2025/03/21
03-22
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值