# windows配置pytorch环境
# conda previous version
# https://repo.anaconda.com/archive/
# pytorch previous version
# https://pytorch.org/get-started/previous-versions/
pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cu12
问题描述:
VS-Code的python插件问题:
The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted.
解决方法:
https://github.com/microsoft/vscode-python/issues/3977
Turning on the language server
In your settings.json, set "python.languageServer": "Microsoft". You will then be prompted to restart VS Code. If you have not downloaded the language server before then that will be triggered when you trigger the extension by opening a Python file.
Issues directly related to the language server -- e.g. completions -- should be reported to the Microsoft/python-language-server issue tracker.
翻译过来就是在 .vscode/settings.json
里,加一句 "python.languageServer": "Microsoft"
,就会安装python相关的文件分析服务器。
Docker报错问题:
ImportError: libGL.so.1: cannot open shared object file: No such file or directory——docker
解决方法:
环境是ubuntu16.04。
指令:
sudo apt update
sudo apt install libgl1-mesa-glx
Anaconda下载包速度慢:
https://repo.anaconda.com/archive/
解决方法:
境内下载速度慢,修改为 清华源 中科大源:
清华源速度慢,而且之前闹过授权问题,所以现在换成了中科大源
直接打开cmd输入一下命令
-i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
# conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
包括下面的地址
# https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
# https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
# https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
# https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
# https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
或者直接修改~/.condarc:
sudo vim ~/.condarc
改成如下
channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
ssl_verify: false
注意,如果使用了清华源,要删除,执行:
conda config --remove channels
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda install: Segmentation fault(段错误):
之前用清华源,安装的时候网络不良导致中途出错,于是有些包虽然在本地缓存了,但其实不完整。
解决方法:删除所有缓存:
conda clean -a
其他的源:
# 创建名为 .condarc 的文件
conda config --set show_channel_urls yes
# 清除索引缓存,保证用的是镜像站提供的索引
conda c lean -i
# 豆瓣源
conda config --add channels https://pypi.douban.com/anaconda/cloud/conda-forge/
conda config --add channels https://pypi.douban.com/anaconda/cloud/msys2/
conda config --add channels https://pypi.douban.com