conda虚拟环境中pip的混淆

在conda的虚拟环境中,会在<PATH>\Anaconda\envs\<ENV_NAME>\Scripts目录下存在 pip.exepip3.exe.

如果存在多个虚拟环境是,加上conda自带的python版本,系统中存在多个pippip3指令,在执行安装的时候,可能由于环境变量的顺序,会导致在虚拟环境ENV_NAME中,仍然调用的是系统自带的pippip3指令,导致删除或安装包的时候,路径发生错误。

因此,可以讲虚拟环境中的pip3.exe指令进行修改为pip-<envname>.exe,同步修改其pip3-scripts.py脚本为pip3-<envname>-scripts.py

修改完成后可以在当前虚拟环境中调用对应的pip,而无法使用其他环境的pip指令。

相关推荐
心 爱心 爱3 小时前
pip 隔离环境内 安装 cuda 113 不覆盖原有的全局 cuda 115
pip·cuda·隔离环境
万粉变现经纪人1 天前
如何解决 pip install mysqlclient 报错 ‘mysql_config’ not found 问题
数据库·python·mysql·pycharm·bug·pandas·pip
乘风对月歌2 天前
conda 或 vscode 中没有的虚拟环境
ide·vscode·conda
比奇堡的猪猪2 天前
修改默认conda环境(在win中)
python·conda
hui函数2 天前
如何解决 pip install 编译报错 ‘cl.exe’ not found(缺少 VS C++ 工具集)问题
开发语言·c++·pip
hui函数2 天前
Python系列Bug修复|如何解决 pip install 安装报错 invalid command ‘bdist_wheel’(缺少 wheel)问题
python·bug·pip
hui函数2 天前
Python系列Bug修复|如何解决 pip install -r requirements.txt 私有索引未设为 trusted-host 导致拒绝 问题
python·bug·pip
hui函数3 天前
Python系列Bug修复|如何解决 pip install 安装报错 Backend ‘setuptools.build_meta’ 不可用 问题
python·bug·pip
hui函数3 天前
Python系列Bug修复|如何解决 pip install -r requirements.txt 私有仓库认证失败 401 Unauthorized 问题
python·bug·pip
hui函数3 天前
Python系列Bug修复|如何解决 pip install -r requirements.txt 子目录可编辑安装缺少 pyproject.toml 问题
python·bug·pip