Python环境搭建

6 篇文章 0 订阅
2 篇文章 0 订阅

Install Python on Your Linux OS

Install conda

How to run pytorch or tensorflow in the docker.

procedure

1 - install Vim, bunzip, net tools and wget

    apt install vim
    apt install bzip2
    apt install net-tools
    apt install wget

2 - change the yum source if you’d like:

    vim /etc/apt/sources.list

You can follow the instructions step by step on https://blog.csdn.net/GenuineMonster/article/details/82716948

3 - install conda

  • Download conda from https://www.anaconda.com/.
    wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
  • Installation
    bash Anaconda3-2019.10-Linux-x86_64.sh

For more detail, please move to https://docs.continuum.io/anaconda/install/linux/.
Command pip is not recommended for managing the python virtual environment. If you have to use command pip install to add a package in your env, you’d better to change your python lib search path to make sure that the installed package will not affect other python envs.

4 - manage python environments

  • create a python environment
    conda create --name pytorch_1.3_CU_10 python=3.6
  • switch to pytorch_1.3_CU_10
    conda activate pytorch_1.3_CU_10 

5 - install pytorch

  • pytorch installation.

Please refer to pytorch official website: https://pytorch.org/get-started/locally/

    conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
  • Verification
    python pytorch_verification.py
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值