资料: https://mirrors.bfsu.edu.cn/help/anaconda/
参考: https://www.jianshu.com/p/edaa744ea47d
conda 简介
Conda 是一个开源的软件包管理系统和环境管理系统,用于安装多个版本的软件包及其依赖关系,并在它们之间轻松切换。 Conda 是为 Python 程序创建的,适用于 Linux,OS X 和Windows,也可以打包和分发其他软件。
Anaconda 与 miniconda,前者包括较多的人工智能、数据分析、深度学习的包,都有 conda,用于包管理,环境管理。
本次使用的是 miniconda
下载地址: https://docs.conda.io/en/latest/miniconda.html
根据提示安装即可
配置镜像
都说清华镜像好,那就清华的吧
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.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config —add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
# 查看版本
PS D:\devTools\Python\virtual_env> conda --version
conda 4.11.0
PS D:\devTools\Python\virtual_env>
PS D:\devTools\Python\virtual_env>
# 添加清华镜像
PS D:\devTools\Python\virtual_env> conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
PS D:\devTools\Python\virtual_env> conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
PS D:\devTools\Python\virtual_env> conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
PS D:\devTools\Python\virtual_env> conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
PS D:\devTools\Python\virtual_env>
查看镜像
conda config —set show_channel_urls yes
conda config —get channels
PS D:\devTools\Python\virtual_env> conda config --set show_channel_urls yes
PS D:\devTools\Python\virtual_env>
PS D:\devTools\Python\virtual_env> conda config --get channels
--add channels 'defaults' # lowest priority
--add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
--add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/'
--add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/'
--add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/' # highest priority
PS D:\devTools\Python\virtual_env>
PS D:\devTools\Python\virtual_env>
conda 的 help
conda —help
PS D:\devTools\Python\virtual_env> conda --help
usage: conda-script.py [-h] [-V] command ...
conda is a tool for managing and deploying applications, environments and packages.
Options:
positional arguments:
command
clean Remove unused packages and caches.
compare Compare packages between conda environments.
config Modify configuration values in .condarc. This is modeled after the git config command. Writes to the user .condarc file
(C:\Users\DELL\.condarc) by default.
create Create a new conda environment from a list of specified packages.
help Displays a list of available conda commands and their help strings.
info Display information about current conda install.
init Initialize conda for shell interaction. [Experimental]
install Installs a list of packages into a specified conda environment.
list List linked packages in a conda environment.
package Low-level conda package utility. (EXPERIMENTAL)
remove Remove a list of packages from a specified conda environment.
uninstall Alias for conda remove.
run Run an executable in a conda environment. [Experimental]
search Search for packages and display associated information. The input is a MatchSpec, a query language for conda packages. See
examples below.
update Updates conda packages to the latest compatible version.
upgrade Alias for conda update.
optional arguments:
-h, --help Show this help message and exit.
-V, --version Show the conda version number and exit.
conda commands available from other packages:
content-trust
env
PS D:\devTools\Python\virtual_env>
环境管理
conda env list 查看安装的环境
conda env list
PS D:\devTools\Python\virtual_env> conda env list
# conda environments:
#
base * D:\devTools\Python\Miniconda3
PS D:\devTools\Python\virtual_env>
新环境只有一个 base 的 env,建议不要删除。
conda create -n env_name python=python_version 创建env
conda create -n python36 python=3.6 会默认安装 python3.6 当期最新版本
PS D:\devTools\Python\virtual_env> conda create -n python36 python=3.6
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\devTools\Python\Miniconda3\envs\python36
added / updated specs:
- python=3.6
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2020.6.20 | pyhd3eb1b0_3 155 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pip-20.0.2 | py36_1 1.9 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python-3.6.15 |h39d44d4_0_cpython 18.9 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python_abi-3.6 | 2_cp36m 4 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
setuptools-49.6.0 | py36ha15d459_3 921 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ucrt-10.0.20348.0 | h57928b3_0 1.2 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
vc-14.2 | hb210afc_6 13 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
vs2015_runtime-14.29.30037 | h902a5da_6 1.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wheel-0.37.1 | pyhd8ed1ab_0 31 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wincertstore-0.2 |py36ha15d459_1006 15 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
------------------------------------------------------------
Total: 24.4 MB
The following NEW packages will be INSTALLED:
done
#
# To activate this environment, use
#
# $ conda activate python36
#
# To deactivate an active environment, use
#
# $ conda deactivate
PS D:\devTools\Python\virtual_env>
当然,安装python环境的时候可以同时指定需要的包,比如 Django、flask、Djangorestframework 等,比如:
conda create -n python27 python=2.7 django djangorestframework
PS D:\devTools\Python\virtual_env> conda create -n python27 python=2.7 django djangorestframework
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\devTools\Python\Miniconda3\envs\python27
added / updated specs:
- django
- djangorestframework
- python=2.7
The following packages will be downloaded:
package | build
---------------------------|-----------------
django-1.11.25 | py27h85ba907_0 4.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
djangorestframework-3.6.3 | py27_0 964 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pip-20.0.2 | py27_1 1.9 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python-2.7.15 |h2880e7c_1011_cpython 20.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python_abi-2.7 | 1_cp27m 4 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pytz-2019.3 | py_0 237 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
setuptools-36.4.0 | py27_1 525 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vc-9 | h2eaa2aa_6 5 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
vs2008_runtime-9.0.30729.6161| 0 1.0 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wincertstore-0.2 | py27_1003 13 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
------------------------------------------------------------
Total: 29.3 MB
The following NEW packages will be INSTALLED:
certifi anaconda/pkgs/main/noarch::certifi-2020.6.20-pyhd3eb1b0_3
done
#
# To activate this environment, use
#
# $ conda activate python27
#
# To deactivate an active environment, use
#
# $ conda deactivate
PS D:\devTools\Python\virtual_env>
conda activate env_name 激活环境
conda activate python27
C:\Users\DELL>echo %OS%
Windows_NT
C:\Users\DELL>conda env list
# conda environments:
#
base * D:\devTools\Python\Miniconda3
python27 D:\devTools\Python\Miniconda3\envs\python27
python36 D:\devTools\Python\Miniconda3\envs\python36
C:\Users\DELL>conda activate python27
(python27) C:\Users\DELL>
注意: 我的 Windows power shell 无法执行成功,要换 cmd 执行;
激活之后,前面会显示env名称,此次激活的就是 Python27,显示在了前面。
现在就可以像原来安装的对应版本进行使用 python 了。
简单使用(像本地的python一样,pip管理包)
(python27) C:\Users\DELL>python -V
Python 2.7.15
(python27) C:\Users\DELL>pip --version
pip 20.0.2 from D:\devTools\Python\Miniconda3\envs\python27\lib\site-packages\pip (python 2.7)
(python27) C:\Users\DELL>
(python27) C:\Users\DELL>pip list
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package Version
------------------- ---------
certifi 2020.6.20
Django 1.11.25
djangorestframework 3.6.3
pip 20.0.2
pytz 2019.3
setuptools 36.4.0
wheel 0.37.1
wincertstore 0.2
(python27) C:\Users\DELL>
使用 conda 进行包管理
(python27) C:\Users\DELL>conda list # 查看已安装的包
# packages in environment at D:\devTools\Python\Miniconda3\envs\python27:
#
# Name Version Build Channel
certifi 2020.6.20 pyhd3eb1b0_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
django 1.11.25 py27h85ba907_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
djangorestframework 3.6.3 py27_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pip 20.0.2 py27_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python 2.7.15 h2880e7c_1011_cpython https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python_abi 2.7 1_cp27m https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pytz 2019.3 py_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
setuptools 36.4.0 py27_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vc 9 h2eaa2aa_6 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
vs2008_runtime 9.0.30729.6161 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wheel 0.37.1 pyhd8ed1ab_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wincertstore 0.2 py27_1003 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
(python27) C:\Users\DELL>
(python27) C:\Users\DELL>conda install drf_yasg # 安装 drf_yasg
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- drf_yasg
Current channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
(python27) C:\Users\DELL>
C:\Users\DELL>conda search drf_yasg
Loading channels: done
No match found for: drf_yasg. Search: *drf_yasg*
PackagesNotFoundError: The following packages are not available from current channels:
- drf_yasg
Current channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
C:\Users\DELL>conda search drf-yasg
Loading channels: done
# Name Version Build Channel
drf-yasg 1.17.1 py_0 anaconda/cloud/conda-forge
drf-yasg 1.20.0 py_0 anaconda/cloud/conda-forge
C:\Users\DELL>conda activate python27
(python27) C:\Users\DELL>conda install drf-yasg
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\devTools\Python\Miniconda3\envs\python27
added / updated specs:
- drf-yasg
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2019.11.28 | py27h8c360ce_1 149 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
coreapi-2.3.3 | pyh9f0ad1d_0 23 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
coreschema-0.0.4 | pyh9f0ad1d_0 15 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
djangorestframework-3.9.4 | py_0 756 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
drf-yasg-1.20.0 | py_0 1.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
inflection-0.5.1 | pyh9f0ad1d_0 9 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
itypes-1.2.0 | pyh9f0ad1d_0 7 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
jinja2-2.11.3 | pyh44b312d_0 93 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
markupsafe-1.1.1 | py27h462b5f4_1 26 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
packaging-20.9 | pyh44b312d_0 35 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyparsing-2.4.7 | pyh9f0ad1d_0 60 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
requests-2.13.0 | py27_0 780 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ruamel-1.0 | py27h8c360ce_2 4 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ruamel.ordereddict-0.4.14 | py27h0c8e037_0 35 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ruamel.yaml-0.16.6 | py27h462b5f4_1 165 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ruamel.yaml.clib-0.2.0 | py27h462b5f4_1 115 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
simplejson-3.17.0 | py27h462b5f4_1 100 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
six-1.16.0 | pyh6c4a22f_0 14 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
uritemplate-3.0.1 | py_0 16 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
------------------------------------------------------------
Total: 3.6 MB
The following NEW packages will be INSTALLED:
coreapi anaconda/cloud/conda-forge/noarch::coreapi-2.3.3-pyh9f0ad1d_0
coreschema anaconda/cloud/conda-forge/noarch::coreschema-0.0.4-pyh9f0ad1d_0
drf-yasg anaconda/cloud/conda-forge/noarch::drf-yasg-1.20.0-py_0
inflection anaconda/cloud/conda-forge/noarch::inflection-0.5.1-pyh9f0ad1d_0
itypes anaconda/cloud/conda-forge/noarch::itypes-1.2.0-pyh9f0ad1d_0
jinja2 anaconda/cloud/conda-forge/noarch::jinja2-2.11.3-pyh44b312d_0
markupsafe anaconda/cloud/conda-forge/win-64::markupsafe-1.1.1-py27h462b5f4_1
packaging anaconda/cloud/conda-forge/noarch::packaging-20.9-pyh44b312d_0
pyparsing anaconda/cloud/conda-forge/noarch::pyparsing-2.4.7-pyh9f0ad1d_0
requests anaconda/cloud/conda-forge/win-64::requests-2.13.0-py27_0
ruamel anaconda/cloud/conda-forge/win-64::ruamel-1.0-py27h8c360ce_2
ruamel.ordereddict anaconda/cloud/conda-forge/win-64::ruamel.ordereddict-0.4.14-py27h0c8e037_0
ruamel.yaml anaconda/cloud/conda-forge/win-64::ruamel.yaml-0.16.6-py27h462b5f4_1
ruamel.yaml.clib anaconda/cloud/conda-forge/win-64::ruamel.yaml.clib-0.2.0-py27h462b5f4_1
simplejson anaconda/cloud/conda-forge/win-64::simplejson-3.17.0-py27h462b5f4_1
six anaconda/cloud/conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
uritemplate anaconda/cloud/conda-forge/noarch::uritemplate-3.0.1-py_0
The following packages will be UPDATED:
djangorestframewo~ anaconda/cloud/conda-forge/win-64::dj~ --> anaconda/cloud/conda-forge/noarch::djangorestframework-3.9.4-py_0
The following packages will be SUPERSEDED by a higher-priority channel:
done
(python27) C:\Users\DELL>
conda deaactivate 退出环境
conda deactivate
(python27) C:\Users\DELL>conda deactivate
C:\Users\DELL>
退出后,前面的env名称消失
其它命令
参考: https://zhuanlan.zhihu.com/p/44398592
# 安装package
conda install -n py35 numpy
# 如果不用-n指定环境名称,则被安装在当前活跃环境
# 也可以通过-c指定通过某个channel安装
C:\Users\DELL>conda list --help
usage: conda-script.py list [-h] [-n ENVIRONMENT | -p PATH] [--json] [-v] [-q] [--show-channel-urls] [-c] [-f] [--explicit] [--md5] [-e] [-r]
[--no-pip]
[regex]
List linked packages in a conda environment.
Options:
positional arguments:
regex List only packages matching this regular expression.
optional arguments:
-h, --help Show this help message and exit.
--show-channel-urls Show channel urls. Overrides the value given by `conda config --show show_channel_urls`.
-c, --canonical Output canonical names of packages only. Implies --no-pip.
-f, --full-name Only search for full names, i.e., ^<regex>$.
--explicit List explicitly all installed conda packaged with URL (output may be used by conda create --file).
--md5 Add MD5 hashsum when using --explicit
-e, --export Output requirement string only (output may be used by conda create --file).
-r, --revisions List the revision history and exit.
--no-pip Do not include pip-only installed packages.
Target Environment Specification:
-n ENVIRONMENT, --name ENVIRONMENT
Name of environment.
-p PATH, --prefix PATH
Full path to environment location (i.e. prefix).
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.
Examples:
List all packages in the current environment::
conda list
List all packages installed into the environment 'myenv'::
conda list -n myenv
Save packages for future use::
conda list --export > package-list.txt
Reinstall packages from an export file::
conda create -n myenv --file package-list.txt
C:\Users\DELL>conda list --name python36 # 查看python36环境安装的package
# packages in environment at D:\devTools\Python\Miniconda3\envs\python36:
#
# Name Version Build Channel
certifi 2020.6.20 pyhd3eb1b0_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pip 20.0.2 py36_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python 3.6.15 h39d44d4_0_cpython https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python_abi 3.6 2_cp36m https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
setuptools 49.6.0 py36ha15d459_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ucrt 10.0.20348.0 h57928b3_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
vc 14.2 hb210afc_6 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
vs2015_runtime 14.29.30037 h902a5da_6 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wheel 0.37.1 pyhd8ed1ab_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wincertstore 0.2 py36ha15d459_1006 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
C:\Users\DELL>
conda 使用不同的bit python
切换 win-32:set CONDA_FORCE_32BIT=1
在 cmd 运行 set CONDA_FORCE_32BIT=1 ,标识当前为 32 位的环境
Microsoft Windows [版本 10.0.18363.1556]
(c) 2019 Microsoft Corporation。保留所有权利。
## 查看环境,其中 platform 现在是 win-64
C:\Users\DELL>conda info
active environment : None
user config file : C:\Users\DELL\.condarc
populated config files : C:\Users\DELL\.condarc
conda version : 4.11.0
conda-build version : not installed
python version : 3.9.7.final.0
virtual packages : __win=0=0
__archspec=1=x86_64
base environment : D:\devTools\Python\Miniconda3 (writable)
conda av data dir : D:\devTools\Python\Miniconda3\etc\conda
conda av metadata url : None
channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : D:\devTools\Python\Miniconda3\pkgs
C:\Users\DELL\.conda\pkgs
C:\Users\DELL\AppData\Local\conda\conda\pkgs
envs directories : D:\devTools\Python\Miniconda3\envs
C:\Users\DELL\.conda\envs
C:\Users\DELL\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.11.0 requests/2.27.1 CPython/3.9.7 Windows/10 Windows/10.0.18363
administrator : False
netrc file : None
offline mode : False
## 设置为32 位
C:\Users\DELL>set CONDA_FORCE_32BIT=1
## 再次查看,现在 platform 就是 win-32, 就可以正常安装需要的 32 位的 python 了
C:\Users\DELL>conda info
active environment : None
user config file : C:\Users\DELL\.condarc
populated config files : C:\Users\DELL\.condarc
conda version : 4.11.0
conda-build version : not installed
python version : 3.9.7.final.0
virtual packages : __win=0=0
__archspec=1=x86
base environment : D:\devTools\Python\Miniconda3 (writable)
conda av data dir : D:\devTools\Python\Miniconda3\etc\conda
conda av metadata url : None
channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/win-32
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-32
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-32
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-32
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
https://repo.anaconda.com/pkgs/main/win-32
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-32
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-32
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : D:\devTools\Python\Miniconda3\pkgs32
C:\Users\DELL\.conda\pkgs32
C:\Users\DELL\AppData\Local\conda\conda\pkgs32
envs directories : D:\devTools\Python\Miniconda3\envs
C:\Users\DELL\.conda\envs
C:\Users\DELL\AppData\Local\conda\conda\envs
platform : win-32
user-agent : conda/4.11.0 requests/2.27.1 CPython/3.9.7 Windows/10 Windows/10.0.18363
administrator : False
netrc file : None
offline mode : False
C:\Users\DELL>
切换 win-64:set CONDA_FORCE_32BIT=0
C:\Users\DELL>conda info
active environment : None
user config file : C:\Users\DELL\.condarc
populated config files : C:\Users\DELL\.condarc
conda version : 4.11.0
conda-build version : not installed
python version : 3.9.7.final.0
virtual packages : __win=0=0
__archspec=1=x86
base environment : D:\devTools\Python\Miniconda3 (writable)
conda av data dir : D:\devTools\Python\Miniconda3\etc\conda
conda av metadata url : None
channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/win-32
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-32
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-32
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-32
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
https://repo.anaconda.com/pkgs/main/win-32
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-32
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-32
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : D:\devTools\Python\Miniconda3\pkgs32
C:\Users\DELL\.conda\pkgs32
C:\Users\DELL\AppData\Local\conda\conda\pkgs32
envs directories : D:\devTools\Python\Miniconda3\envs
C:\Users\DELL\.conda\envs
C:\Users\DELL\AppData\Local\conda\conda\envs
platform : win-32
user-agent : conda/4.11.0 requests/2.27.1 CPython/3.9.7 Windows/10 Windows/10.0.18363
administrator : False
netrc file : None
offline mode : False
## 切换回到 win-64
C:\Users\DELL>set CONDA_FORCE_32BIT=0
C:\Users\DELL>
C:\Users\DELL>
C:\Users\DELL>conda info
active environment : None
user config file : C:\Users\DELL\.condarc
populated config files : C:\Users\DELL\.condarc
conda version : 4.11.0
conda-build version : not installed
python version : 3.9.7.final.0
virtual packages : __win=0=0
__archspec=1=x86_64
base environment : D:\devTools\Python\Miniconda3 (writable)
conda av data dir : D:\devTools\Python\Miniconda3\etc\conda
conda av metadata url : None
channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : D:\devTools\Python\Miniconda3\pkgs
C:\Users\DELL\.conda\pkgs
C:\Users\DELL\AppData\Local\conda\conda\pkgs
envs directories : D:\devTools\Python\Miniconda3\envs
C:\Users\DELL\.conda\envs
C:\Users\DELL\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.11.0 requests/2.27.1 CPython/3.9.7 Windows/10 Windows/10.0.18363
administrator : False
netrc file : None
offline mode : False
C:\Users\DELL>