除python之外的Conda更新包

除python之外的Conda更新包,python,package,conda,update-all,Python,Package,Conda,Update All,我是python的初学者,我正在使用anaconda的旧版本,它有python的3.5.2版本,因为我想使用tensorflow。我有一些过时的软件包,我想用“conda update all”更新。有没有一种方法可以在不将python从3.5更新到3.6的情况下实现这一点,因为这与tensorflow不兼容?您可以手动将它们全部更新conda update yourpackage …或者您可以全部更新它们conda update--all,然后使用conda install python=3.

我是python的初学者,我正在使用anaconda的旧版本,它有python的3.5.2版本,因为我想使用tensorflow。我有一些过时的软件包,我想用“conda update all”更新。有没有一种方法可以在不将python从3.5更新到3.6的情况下实现这一点,因为这与tensorflow不兼容?

您可以手动将它们全部更新
conda update yourpackage

…或者您可以全部更新它们
conda update--all
,然后使用
conda install python=3.5.2

简短回答再次降级python
conda update--all--dry run 2>/dev/null|
grep-Fe'-->'|
切割-d''-f3|
grep-ve'python'|
xargs conda更新

长话短说 步骤1:试运行以检查要更新的包 命令

conda update--all--dry run
结果

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0



DryRunExit: Dry run. Exiting.
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
astroid
ca-certificates
openssl
pip
pylint
python
sqlite
astroid
ca-certificates
openssl
pip
pylint
sqlite

步骤2:删除来自stderr的消息(可选,但更清晰) 命令

conda update--all--dry run 2>/dev/null
结果

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0



DryRunExit: Dry run. Exiting.
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
astroid
ca-certificates
openssl
pip
pylint
python
sqlite
astroid
ca-certificates
openssl
pip
pylint
sqlite

步骤3:提取具有包名称的行 命令

conda update--all--dry run 2>/dev/null|
grep-Fe'-->'
结果

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0



DryRunExit: Dry run. Exiting.
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
astroid
ca-certificates
openssl
pip
pylint
python
sqlite
astroid
ca-certificates
openssl
pip
pylint
sqlite

步骤4:生成包名称列表 命令

conda update--all--dry run 2>/dev/null|
grep-Fe'-->'|
切割-d''-f3
注意:由于每个包名称前面有2个空格,因此包名称是该行的第3个字段。这将导致参数
-f3

结果

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0



DryRunExit: Dry run. Exiting.
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
astroid
ca-certificates
openssl
pip
pylint
python
sqlite
astroid
ca-certificates
openssl
pip
pylint
sqlite

步骤5:从列表中删除不需要更新的包 命令

conda update--all--dry run 2>/dev/null|
grep-Fe'-->'|
切割-d''-f3|
grep-ve'python'
结果

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0



DryRunExit: Dry run. Exiting.
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: //anaconda3/envs/general


The following packages will be UPDATED:

  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
  astroid                                      2.3.1-py37_0 --> 2.3.2-py37_0
  ca-certificates                               2019.8.28-0 --> 2019.10.16-0
  openssl                                 1.0.2t-h1de35cc_1 --> 1.1.1d-h1de35cc_3
  pip                                         19.2.3-py37_0 --> 19.3.1-py37_0
  pylint                                       2.4.2-py37_0 --> 2.4.3-py37_0
  python                                   3.7.0-hc167b69_0 --> 3.7.4-h359304d_1
  sqlite                                  3.30.0-ha441bb4_0 --> 3.30.1-ha441bb4_0
astroid
ca-certificates
openssl
pip
pylint
python
sqlite
astroid
ca-certificates
openssl
pip
pylint
sqlite

步骤6:从列表中更新包 命令

conda update--all--dry run 2>/dev/null|
grep-Fe'-->'|
切割-d''-f3|
grep-ve'python'|
xargs conda更新