pip环境中
检查版本
python --version
pip --version
更新版本
python -m pip install --upgrade pip
清除缓存
python -m pip cache purge
pip:This error originates from a subprocess, and is likely not a problem with pip
This error originates from a subprocess, and is likely not a problem with pip
Anaconda虚拟环境中
查看当前虚拟环境的版本
1.python版本 python -V
2.conda版本 conda -V
查看当前虚拟环境
conda env list
conda info -e
查看安装了什么包
conda list
检查更新当前conda
conda update conda
python变更为指定版本
卸载python
conda uninstall python
变更版本
conda install python=3.8
出现问题Solving environment: failed with initial frozen solve. Retrying with flexible solve.先卸载再执行conda install python=3.8
新建虚拟环境
- 指定路径添加 conda create -p G:/tensorflow2/envs/虚拟环境名称 python=3.8
- conda create - n 虚拟环境名称 python=3.8
Collecting package metadata (current_repodata.json): failed同时current_repodata.json找不到
conda报错:Collecting package metadata (current_repodata.json): failed - 知乎 (zhihu.com)https://zhuanlan.zhihu.com/p/673594875
Anaconda环境安装问题_repodata.json-CSDN博客https://blog.csdn.net/l714417743/article/details/119718743
Anaconda :解决 CondaHTTPError 问题(必定有效版) - 知乎 (zhihu.com)https://zhuanlan.zhihu.com/p/495333676
删除虚拟环境
conda remove -n 虚拟环境名 -all
跳转到虚拟环境路径后
激活虚拟环境
activate 虚拟环境名
关闭虚拟环境
deativate 虚拟环境名
删除虚拟环境中的某个包
方法1: conda remove --name $虚拟环境名 $ 安装的包名(如numpy)
方法2: pip uninstall 包名
修改虚拟环境路径
虚拟环境中安装指定包
方法 1.激活虚拟环境后pip install 包名
方法 2.G:\tensorflow2\envs\my_tensorflow\Scripts>pip install -i https://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com --target=G:\tensorflow2\envs\my_tensorflow\Lib\site-packages numpy==1.24.3
方法 2不懂见连接
镜像源
显示镜像源
conda config --show channels
删除所有镜像源
恢复原始镜像源状态
conda config --remove-key channels
添加镜像源
(可以更改为其余地址)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
常见镜像源
在以下链接可以查看常见镜像源
Anaconda中如何配置国内镜像源安装外部库(含conda永久配置和pip临时配置方法)_conda中科大镜像源-CSDN博客
https://blog.csdn.net/SUNYUAN0627/article/details/130181974