zoukankan      html  css  js  c++  java
  • conda

    查看conda环境:conda env list

    新建conda环境(env_name就是创建的环境名,可以自定义):conda create -n env_name

    激活conda环境(ubuntu与Macos 将conda 替换为source):conda activate env_name

    退出conda环境:conda deactivate

    安装和卸载python包:conda install numpy # conda uninstall numpy

    查看已安装python列表:conda list -n env_name

    不激活base

    conda config --set auto_activate_base false

    国内源:

    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 --set show_channel_urls yes

    例如:

    conda create -n TF_2C python=3.7

    conda activate TF_2C

     sudo pip install opencv-python

    下载地址

    https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/

    Jupyter环境

    conda install notebook ipykernel

    jupyter notebook 启动

    jupyter notebook --no-browser --port 8888 --ip=0.0.0.0

     

    l  生成一个 notebook 配置文件

    默认情况下,配置文件 ~/.jupyter/jupyter_notebook_config.py 并不存在,需要自行创建。使用下列命令生成配置文件:

    jupyter notebook --generate-config

    l  生成密码

    自动生成

    从 jupyter notebook 5.0 版本开始,提供了一个命令来设置密码:jupyter notebook password,生成的密码存储在 jupyter_notebook_config.json。

    $ jupyter notebook password

    Enter password:  ****

    Verify password: ****

    l  修改配置文件

    在 jupyter_notebook_config.py 中找到下面的行,取消注释并修改。

    c.NotebookApp.ip='*'       #在所有的网卡接口上开启服务

    c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口1234

    c.NotebookApp.allow_remote_access = True  #允许远程

    TF2.0

    conda activate TF_2C

    pip install tensorflow==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

    import tensorflow as tf
    version = tf.__version__
    gpu_ok = tf.test.is_gpu_available
    print("tf version:",version,"
     use GPU",gpu_ok)
    

      

     

  • 相关阅读:
    LeetCode Count of Range Sum
    LeetCode 158. Read N Characters Given Read4 II
    LeetCode 157. Read N Characters Given Read4
    LeetCode 317. Shortest Distance from All Buildings
    LeetCode Smallest Rectangle Enclosing Black Pixels
    LeetCode 315. Count of Smaller Numbers After Self
    LeetCode 332. Reconstruct Itinerary
    LeetCode 310. Minimum Height Trees
    LeetCode 163. Missing Ranges
    LeetCode Verify Preorder Serialization of a Binary Tree
  • 原文地址:https://www.cnblogs.com/ahuo/p/11671928.html
Copyright © 2011-2022 走看看