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


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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值