Fork me on GitHub

Windows,Linux及python的一些命令

正常的pip命令

pip install h5py==2.9.0 --user -i https://pypi.douban.com/simple/ ## 添加镜像源并且设置版本和管理员模式运行
pip list ## 列出当前第三方库及其版本

conda环境下命令

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.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/


conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --remove-key channels


usage: conda-script.py config [-h] [--json] [-v] [-q]
                              [--system | --env | --file FILE]
                              [--show [SHOW [SHOW ...]] | --show-sources |
                              --validate | --describe
                              [DESCRIBE [DESCRIBE ...]] | --write-default]
                              [--get [KEY [KEY ...]] | --append KEY VALUE |
                              --prepend KEY VALUE | --set KEY VALUE | --remove
                              KEY VALUE | --remove-key KEY | --stdin]

Modify configuration values in .condarc.  This is modeled after the git
config command.  Writes to the user .condarc file (C:\Users\WalterJ726\.condarc) by default.

Options:

optional arguments:
  -h, --help            Show this help message and exit.

Output, Prompt, and Flow Control Options:
  --json                Report all output as json. Suitable for using conda
                        programmatically.
  -v, --verbose         Use once for info, twice for debug, three times for
                        trace.
  -q, --quiet           Do not display progress bar.

Config File Location Selection:
  Without one of these flags, the user config file at 'C:\Users\WalterJ726\.condarc' is used.

  --system              Write to the system .condarc file at
                        'd:\ProgramData\Anaconda3\.condarc'.
  --env                 Write to the active conda environment .condarc file
                        (d:\ProgramData\Anaconda3\envs\imageProcessing). If no
                        environment is active, write to the user config file
                        (C:\Users\WalterJ726\.condarc).
  --file FILE           Write to the given file.

Config Subcommands:
  --show [SHOW [SHOW ...]]
                        Display configuration values as calculated and
                        compiled. If no arguments given, show information for
                        all configuration values.
  --show-sources        Display all identified configuration sources.
  --validate            Validate all configuration sources.
  --describe [DESCRIBE [DESCRIBE ...]]
                        Describe given configuration parameters. If no
                        arguments given, show information for all
                        configuration parameters.
  --write-default       Write the default configuration to a file. Equivalent
                        to `conda config --describe > ~/.condarc`.

Config Modifiers:
  --get [KEY [KEY ...]]
                        Get a configuration value.
  --append KEY VALUE    Add one configuration value to the end of a list key.
  --prepend KEY VALUE, --add KEY VALUE
                        Add one configuration value to the beginning of a list
                        key.
  --set KEY VALUE       Set a boolean or string key
  --remove KEY VALUE    Remove a configuration value from a list key. This
                        removes all instances of the value.
  --remove-key KEY      Remove a configuration key (and all its values).
  --stdin               Apply configuration information given in yaml format
                        piped through stdin.

See `conda config --describe` or https://conda.io/docs/config.html
for details on all the options that can go in .condarc.

Examples:

Display all configuration values as calculated and compiled:

    conda config --show

Display all identified configuration sources:

    conda config --show-sources

Describe all available configuration options:

    conda config --describe

Add the conda-canary channel:

    conda config --add channels conda-canary

Set the output verbosity to level 3 (highest) for the current activate environment:

    conda config --set verbosity 3 --env

Add the 'conda-forge' channel as a backup to 'defaults':

    conda config --append channels conda-forge

Linux,gitbash命令

要运行Linux命令行可以在gitbash下运行

git clone https://github.com/tensorflow/models.git  ## 把git地址放到后面

Google的colab命令

https://www.cnblogs.com/zgqcn/p/11486186.html

from google.colab import drive
drive.mount('/content/drive')
# 指定当前的工作文件夹
import os
# 此处为google drive中的文件路径,drive为之前指定的工作根目录,要加上
os.chdir("/content/drive/My Drive/first/colab") 
%tensorflow_version 1.x  ## colab默认的TensorFlow为1.x版本,要使用2.x不用重新安装,只需在导入tensorflow之前输入%tensorflow_version 2.x
!python tfrecord.py   ## 运行所有的命令都加个感叹号就可以了
posted @ 2020-05-10 12:42  WalterJ726  阅读(233)  评论(0编辑  收藏  举报