关于conda环境
查看现有环境:conda env list
创建环境:conda create -n 环境名 python=3.8
激活:conda activate 环境名
退出激活:conda deactivate
删除环境:conda remove -n 环境明 --all
1、将环境配置到jupyter notebook上,将环境加载进jupyter中
pip install -i https://pypi.douban.com/simple ipykernel
python -m ipykernel install --name 环境名
2、先装,要不然会出现很多错误
conda install matplotlib==3.2.2
conda install pillow==7.2.0
conda install pandas==1.0.5
安装pytorch
https://pytorch.org/get-started/previous-versions/
CPU版本
# CPU Only
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cpuonly -c pytorch
GPU版本
查看显卡支持的cuda,可以向下兼容;例如我的:<12.0都可以
cuda官网 https://developer.nvidia.com/cuda-downloads
https://developer.nvidia.com/cuda-toolkit-archive
别这么下!!!!!很容易下成CPU版本的
# CUDA 10.2 √
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=10.2 -c pytorch
# CUDA 11.3
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch
# CUDA 11.6 √√
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.6 -c pytorch -c conda-forge
直接下载包
https://download.pytorch.org/whl/torch_stable.html
ctrl+F,输入cuda版本和你的python版本:例如:cu102-cp38
pip install +whl文件路径
pip install "D:\E_files\torch-1.10.0+cu102-cp38-cp38-win_amd64.whl"
pip install "D:\E_files\torchaudio-0.10.0+cu102-cp38-cp38-win_amd64.whl"
pip install "D:\E_files\torchvision-0.11.0+cu102-cp38-cp38-win_amd64.whl"
conda list
# CUDA 11.6 √√
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.6 -c pytorch -c conda-forge
pip install "D:\E_files\torch_install\torch-1.12.0+cu116-cp38-cp38-win_amd64.whl"
pip install "D:\E_files\torch_install\torchaudio-0.12.0+cu116-cp38-cp38-win_amd64.whl"
pip install "D:\E_files\torch_install\torchvision-0.13.0+cu116-cp38-cp38-win_amd64.whl"
安装 torchvision0.11.0 torchaudio0.10.0 cudatoolkit=10.2
完美!!!
win11也可以用win10的cuda
local下载exe
下载cudnn,csdn上有教程点这里
安装pennylane
https://pennylane.ai/install.html?version=stable
pip install pennylane --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple
安装tensorflow
不行,不是GPU版本
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
win11显卡RTX4060用不了cuda10,下载cuda11.2的版本
不用安装keras已经有了
安装qiskit
pip install qiskit -i https://pypi.tuna.tsinghua.edu.cn/simple
安装qutip
pip install qutip -i https://pypi.tuna.tsinghua.edu.cn/simple