zoukankan      html  css  js  c++  java
  • conda安装

    conda安装

    安装miniconda

    • 安装的时候勾选 add to path

    conda添加源

    #查看当前conda配置
    conda config --show channels
     
    #设置通道
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
     
    #设置搜索是显示通道地址
    conda config --set show_channel_urls yes
     
    conda install pytorch torchvision cudatoolkit=10.0  # 删除安装命令最后的 -c pytorch,才会采用清华源安装。
    

    创建python虚拟环境

    conda create --name py36 python=3.6 
    

    安装相关package

    安装pytorch

    • pytorch-cpu版本
      1. 采用本地安装的方法,百度网盘下载pytorch.xx.whl和torchvision.xx.whl
      2. pip install torch-1.2.0+cpu-cp36-cp36m-win_amd64.whl
      3. pip install torchvision-0.4.0+cpu-cp36-cp36m-win_amd64.whl

    安装matplotlib

    • pip install matplotlib

    安装opencv

    • pip install opencv-python

    更改pip清华镜像

    • Windows下:
      【C:Users你的用户名】目录下,新建pip文件夹,进到文件夹中创建pip.ini文件,然后打开它,将下面代码粘贴进去-->保存
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    [install]
    trusted-host = https://pypi.tuna.tsinghua.edu.cn
    
    • Ubuntu下:
      创建pip.config 文件
    mkdir ~/.pip
    vim ~/.pip/pip.conf
    

    添加pip源

    [global]
    trusted-host =  pypi.mirrors.ustc.edu.cn
    index-url = https://pypi.mirrors.ustc.edu.cn/simple
    
  • 相关阅读:
    idea配置tomcat
    使用svn时出现Can't switch /XXX/XXX because it is not the repository yet
    使用idea断点调试时出现no executable code found at line问题
    python 发送邮件
    python中子类调用父类的方法
    Java源码阅读PriorityQueue
    comparable和comparator
    java源码阅读LinkedBlockingQueue
    java源码阅读ArrayBlockingQueue
    java源码阅读LinkedList
  • 原文地址:https://www.cnblogs.com/lwp-nicol/p/14944111.html
Copyright © 2011-2022 走看看