zoukankan      html  css  js  c++  java
  • 常用命令-python篇

    1. pip 加速命令

    pip install --index-url https://pypi.douban.com/simple  
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 
    

    2. conda加速命令

      # 换用清华conda镜像 
     conda config --prepend channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
      # 也换用科大conda镜像 
     conda config --prepend channels http://mirrors.ustc.edu.cn/anaconda/pkgs/free/
     conda config --set show_channel_urls yes 
     cat ~/.condarc #查看文件内容有无国内源信息,若有,则成功
    

    3 添加python 路径

    export PYTHONPATH=/home/ye/setup/caffe-master/python:$PYTHONPATH

    4 python 主函数头

    if __name__ == '__main__':
        main()
    

    5. pip换源

    ##修改 ~/.pip/pip.conf (没有就创建一个), 
    gedit  ~/.pip/pip.conf
    ##内容如下:
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    
    

    6. pytorch设置卡号

    import os
    os.environ["CUDA_VISIBLE_DEVICES"] = "2"
    
    如果有一天我们淹没在茫茫人海中庸碌一生,那一定是我们没有努力活得丰盛
  • 相关阅读:
    2019-2020-1 20199302《Linux内核原理与分析》第九周作业
    MySQL 优化
    ElasticSearch实战
    redis实战
    ElasticSearch
    Zookeeper
    redis
    Jenkins 持续交付
    JDK 1.8 新特性之Stream
    cat-监控系统
  • 原文地址:https://www.cnblogs.com/yeran/p/10448809.html
Copyright © 2011-2022 走看看