前言:
用Anaconda创建一个环境的命令是:
conda create -n xx python==3.6
(xx是你自己取的名字,python的版本你可以自己指定)
用Anaconda完全删除一个已经创建的环境命令是:
conda remove -n xx --all
1.用命令conda create -n dlearning python==3.6创建很多次都出现下面的情况
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- python==3.6
Current channels:
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/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.
2.用一条命令解决:
conda config --add channels conda-forge
3.再次输入conda create -n dlearning python==3.6成功
lh@lh:~$ conda activate
(base) lh@lh:~$ conda config --add channels conda-forge
(base) lh@lh:~$ conda create -n dlearning python==3.6
Collecting package metadata (current_repodata.json): done
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: /home/lh/anaconda3/envs/dlearning
added / updated specs:
- python==3.6
The following packages will be downloaded:
package | build
---------------------------|-----------------
_libgcc_mutex-0.1 | conda_forge 3 KB conda-forge
_openmp_mutex-4.5 | 1_gnu 22 KB conda-forge
ca-certificates-2021.10.8 | ha878542_0 139 KB conda-forge
libgcc-ng-11.2.0 | h1d223b6_11 887 KB conda-forge
libgomp-11.2.0 | h1d223b6_11 427 KB conda-forge
libzlib-1.2.11 | h36c2ea0_1013 59 KB conda-forge
ncurses-5.9 | 10 1.1 MB conda-forge
openssl-1.0.2u | h516909a_0 3.2 MB conda-forge
pip-21.3.1 | pyhd8ed1ab_0 1.2 MB conda-forge
python-3.6.0 | 2 18.9 MB conda-forge
python_abi-3.6 | 2_cp36m 4 KB conda-forge
readline-6.2 | 0 713 KB conda-forge
setuptools-58.0.4 | py36h5fab9bb_2 966 KB conda-forge
sqlite-3.13.0 | 1 4.9 MB conda-forge
tk-8.5.19 | 2 1.9 MB conda-forge
wheel-0.37.1 | pyhd8ed1ab_0 31 KB conda-forge
xz-5.2.5 | h516909a_1 343 KB conda-forge
zlib-1.2.11 | h36c2ea0_1013 86 KB conda-forge
------------------------------------------------------------
Total: 34.8 MB
The following NEW packages will be INSTALLED:
_libgcc_mutex conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
_openmp_mutex conda-forge/linux-64::_openmp_mutex-4.5-1_gnu
ca-certificates conda-forge/linux-64::ca-certificates-2021.10.8-ha878542_0
libgcc-ng conda-forge/linux-64::libgcc-ng-11.2.0-h1d223b6_11
libgomp conda-forge/linux-64::libgomp-11.2.0-h1d223b6_11
libzlib conda-forge/linux-64::libzlib-1.2.11-h36c2ea0_1013
ncurses conda-forge/linux-64::ncurses-5.9-10
openssl conda-forge/linux-64::openssl-1.0.2u-h516909a_0
pip conda-forge/noarch::pip-21.3.1-pyhd8ed1ab_0
python conda-forge/linux-64::python-3.6.0-2
python_abi conda-forge/linux-64::python_abi-3.6-2_cp36m
readline conda-forge/linux-64::readline-6.2-0
setuptools conda-forge/linux-64::setuptools-58.0.4-py36h5fab9bb_2
sqlite conda-forge/linux-64::sqlite-3.13.0-1
tk conda-forge/linux-64::tk-8.5.19-2
wheel conda-forge/noarch::wheel-0.37.1-pyhd8ed1ab_0
xz conda-forge/linux-64::xz-5.2.5-h516909a_1
zlib conda-forge/linux-64::zlib-1.2.11-h36c2ea0_1013
Proceed ([y]/n)? y
Downloading and Extracting Packages
zlib-1.2.11 | 86 KB | ##################################### | 100%
setuptools-58.0.4 | 966 KB | ##################################### | 100%
readline-6.2 | 713 KB | ##################################### | 100%
_libgcc_mutex-0.1 | 3 KB | ##################################### | 100%
ca-certificates-2021 | 139 KB | ##################################### | 100%
openssl-1.0.2u | 3.2 MB | ##################################### | 100%
ncurses-5.9 | 1.1 MB | ##################################### | 100%
libgcc-ng-11.2.0 | 887 KB | ##################################### | 100%
libzlib-1.2.11 | 59 KB | ##################################### | 100%
wheel-0.37.1 | 31 KB | ##################################### | 100%
libgomp-11.2.0 | 427 KB | ##################################### | 100%
python_abi-3.6 | 4 KB | ##################################### | 100%
_openmp_mutex-4.5 | 22 KB | ##################################### | 100%
sqlite-3.13.0 | 4.9 MB | ##################################### | 100%
pip-21.3.1 | 1.2 MB | ##################################### | 100%
xz-5.2.5 | 343 KB | ##################################### | 100%
tk-8.5.19 | 1.9 MB | ##################################### | 100%
python-3.6.0 | 18.9 MB | ##################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate dlearning
#
# To deactivate an active environment, use
#
# $ conda deactivate
补充一点:
进入环境的命令是conda activate dlearning(这个的dlearning就是你自己取的环境名称)
退出环境的命令是conda deactivate
4.激活环境即可使用
(base) lh@lh:~$ conda activate dlearning
(dlearning) lh@lh:~$
可以看到我们现在就在创建的环境dlearning中,下面就可以开始使用学习了.......