- anaconda使用
- 创建虚拟环境,命令忘了hh
conda activate 虚拟环境(py39)
;输入python
可以激活,此时可以看到python版本号conda install
比pip install
好,会帮你一并安装相关的依赖库- 装错了
conda uninstall xxx
- 改版本,比如说要装torch1.13.1但已经装了1.13.2,
conda install torch==1.13.1
就好 - 有时候安装不了,看报错要考虑用管理员打开的
D: cd axian....
- 配置源
- 不知道安装过多少镜像
conda config --show channels
- 删除源
conda config --remove-key channels
#删除所有的镜像源,恢复到默认conda config --remove channels [urls]
#删除指定的镜像源
- 配置源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
- 以下也建议全部添加
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
conda config --set show_channel_urls yes
- 不知道安装过多少镜像
- pip
conda list
和pip list
不互通,但有时候conda装不了pip能装,我也不懂- 更新pip
python -m pip install --upgrade pip
- 如果依赖很多
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
- 下载cv2的whl(对应python版本)
- 进一步cd到whl下的路径,pip安装xxx.whl
pip install torch
超时- 找到对应python版本的torch torchvision
- 下载相应的torch及torchvision
- 跟上面cv2的安装同理
- pycharm
- 右下角
add New Interpreter
添加解释器- 选第一个虚拟环境
- 勾选
Exis
- 点击解释器右侧的三个点,找到conda虚拟环境,envs下的刚刚建py39下的python.exe
- pycharm里面的Terminal终端下面pip或者conda是可以同步更新的
- 右下角
暂时只想到这些咯