windoes10下CUDA版本切换、conda中python虚拟环境搭建及python pip安装说明

1、多个CUDA版本切换
安装CUDA10.0和CUDA10.2后当切换版本时只需:1、把CUDA_PATH修改为需要的路径;2、NVCUDASAMPLES_ROOT修改为需要的路径;3、在环境变量中相应的路径放置最上面

cmd  查看nvcc --version

修改过后重修打开 cmd 查看nvcc --version

windoes10下CUDA版本切换、conda中python虚拟环境搭建及python pip安装说明_第1张图片
nvidia-smi.exe可查看详细信息
2、conda中python虚拟环境:
Anaconda下载:https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/
Anaconda创建环境:
//下面是创建python=3.6版本的环境,取名叫py36
conda create -n nyyPy37 python=3.7
activate nyyPy37 激活环境
解决Anaconda出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url问题
conda config --set show_channel_urls yes在C:\Users\dell中创建.condarc文件,添加下便内容即可;
channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
show_channel_urls: true
ssl_verify: false

3、python pip安装命令等
tensorflow:
https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/tensorflow/  
各个历史本https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/gpu/
pip install tensorflow-gpu==1.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple --user
pytorch:
http://download.pytorch.org/whl/torch_stable.html Pytorch各个历史本
https://pytorch.org/ 官网
pip install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-win_amd64.whl
pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl
pip install torchvision==0.4.1
Opencv:
https://pypi.tuna.tsinghua.edu.cn/simple  清华大学镜像网站
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple

import cv2  cv2.__version__
安装PIL库:
pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple
安装sklearn :
机器学习相关库scipy, joblib, scikit-learn, sklearn
pip install sklearn -i https://pypi.tuna.tsinghua.edu.cn/simple
安装scikit-image:
pip install scikit-image -i https://pypi.tuna.tsinghua.edu.cn/simple

若更新pip失败时:
easy_install pip
Anaconda中命令行安装库:
Opencv:pip install opencv-python –user
(Opencv安装到c:\users\2\appdata\roaming\python\python37\site-packages)
再次运行pip install opencv-python –user即可查看安装的路径

测试查看版本
pip install -U numpy(更新库)
conda uninstall numpy(卸载库)
pip install -U scikit-image
pip install -U scikit-learn
pip install opencv-python  –user

你可能感兴趣的:(windows,CUDA版本)