以管理员身份启动Anaconda Prompt:
升级conda(升级Anaconda前需要先升级conda):conda update conda
升级anaconda:conda update anaconda
升级最新版本的anaconda-navigator:conda update anaconda-navigator
升级spyder:conda update spyder
更新所有包:conda update --all // 安装完成后,可以对所有工具包进行升级,在命令行执行“conda upgrade --all”,询问是否安装升级版本时,输入y
update conda by running:conda update -n base -c defaults conda
安装包:conda install package
更新包:conda update package
conda env list 显示所有的环境
conda info 显示当前安装的conda信息
conda info --envs 或 conda info -e 显示所有运行环境,其中带有*的是现激活的环境
conda create --name <env_name> 创建新环境
conda create --name your_env_name python=3.7 numpy scipy // 创建名为your_env_name的环境(指定python3.7,包换numpy, scipy)
conda create --name testpy2 python=2.7 pandas 创建名为testpy2的运行环境,并安装pandas包及其依赖包
conda create --name testpy36 python=3.6 anaconda 创建名为testpy36的运行环境,并安装anaconda集合包(conda默认环境)
conda create --name xxxx python=3.5 //创建python3.5的xxxx虚拟环境
conda create --name new_env_name --clone old_env_name // 复制old_env_name,新环境名为new_env_name
conda env remove --name <env_name> // 删除环境
conda remove --name your_env_name --all //删除虚拟环境
source activate your_env_name # for Mac & Linux,激活环境
activate your_env_name # for Windows,激活环境
激活后,terminal输入处开头会有(your_env_name)
source deactivate your_env_name # for Mac & Linux,返回默认环境
deactivate your_env_name # for Windows,返回默认环境
conda update -n base conda // update最新版本的conda
conda --version 或conda -v // 获取版本号
conda --help 或 conda -h // 获取帮助
conda update --help // 查看某一命令的帮助
conda env -h // 查看环境相关的命令
(base) C:\Users\Lenovo>conda -h
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\Lenovo\.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.
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:
build
content-trust
convert
debug
develop
env
index
inspect
metapackage
pack
render
repo
server
skeleton
token
verify
根据“conda -h”的提示信息,修改配置文件(如果没有,可以创建)
这里为“C:\Users\Lenovo.condarc”
proxy_servers:
http: http://10.144.1.10:8080
https: http://10.144.1.10:8080
(base) C:\Users\Lenovo>conda config --show-sources
==> C:\Users\Lenovo\.condarc <==
default_python: None
ssl_verify: True
channels:
- 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/'
- 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
- defaults
show_channel_urls: True
默认情况下,Conda创建的新环境以及过往安装的模块缓存都存储在用户目录。
默认信息不会在Conda(user-specific)配置文件“
H
O
M
E
/
.
c
o
n
d
a
r
c
”
中
体
现
,
但
可
通
过
"
c
o
n
d
a
i
n
f
o
"
查
看
,
包
括
默
认
环
境
路
径
、
默
认
缓
存
路
径
、
C
o
n
d
a
源
设
置
等
。
添
加
或
修
改
“
HOME/.condarc”中体现,但可通过"conda info"查看,包括默认环境路径、默认缓存路径、Conda源设置等。 添加或修改“
HOME/.condarc”中体现,但可通过"condainfo"查看,包括默认环境路径、默认缓存路径、Conda源设置等。添加或修改“HOME/.condarc”中的“env_dirs”和“pkgs_dirs”配置项,可以设置conda环境和缓存(envs directories 和 package cache)的默认路径。
按顺序第一个路径作为默认存储路径,搜索环境和缓存时按先后顺序在各目录中查找。
(base) C:\Users\Lenovo>conda info
active environment : base
active env location : D:\install\Anaconda3
shell level : 1
user config file : C:\Users\Lenovo\.condarc
populated config files : C:\Users\Lenovo\.condarc
conda version : 4.12.0
conda-build version : 3.21.8
python version : 3.7.13.final.0
virtual packages : __cuda=10.2=0
__win=0=0
__archspec=1=x86_64
base environment : D:\install\Anaconda3 (writable)
conda av data dir : D:\install\Anaconda3\etc\conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/'/win-64
https://conda.anaconda.org/'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/'/noarch
https://conda.anaconda.org/'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'/win-64
https://conda.anaconda.org/'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:\install\Anaconda3\pkgs
C:\Users\Lenovo\.conda\pkgs
C:\Users\Lenovo\AppData\Local\conda\conda\pkgs
envs directories : D:\install\Anaconda3\envs
C:\Users\Lenovo\.conda\envs
C:\Users\Lenovo\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.12.0 requests/2.27.1 CPython/3.7.13 Windows/10 Windows/10.0.18362
administrator : False
netrc file : None
offline mode : False
例如:在“$HOME/.condarc”中添加如下路径
envs_dirs:
D:\install\Anaconda3\envs # 按顺序第一个路径作为默认存储路径,搜索环境和缓存时按先后顺序在各目录中查找
C:\Users\Lenovo.conda\envs
C:\Users\Lenovo\AppData\Local\conda\conda\envs
pkgs_dirs:
D:\install\Anaconda3\pkgs
C:\Users\Lenovo.conda\pkgs
C:\Users\Lenovo\AppData\Local\conda\conda\pkgs
也可以使用conda命令指定存放路径:
conda config --add envs_dirs <环境位置绝对路径> # 添加环境位置
conda config --add pkgs_dirs <包位置绝对路径> # 添加包位置
注意:conda和pip都是对当前环境进行安装、升级和卸载包的操作。
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>conda install opencv-python
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:
- opencv-python
Current channels:
- 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.
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>conda config --set use_pip True
CondaValueError: Key 'use_pip' is not a known primitive parameter.
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>pip install opencv-python
Collecting opencv-python
Downloading opencv_python-4.5.5.64-cp36-abi3-win_amd64.whl (35.4 MB)
---------------------------------------- 35.4/35.4 MB 10.7 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17.3 in d:\install\anaconda3\envs\conda_forge_tensorflow_estimator\lib\site-packages (from opencv-python) (1.22.3)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.5.5.64
rocm/tensorflow | 1.10.0 | conda | linux-64 | rocm_py36h4c7c5b9_0, rocm_py27h37a2e76_0, rocm_py35h4a82bb7_0
: TensorFlow is a machine learning library.
rocm/tensorflow-base | 1.10.0 | conda | linux-64 | rocm_py27h43d396a_0, rocm_py35h2a98188_0, rocm_py35h43d396a_0, rocm_py36h43d396a_0
: TensorFlow is a machine learning library, base AMD ROCm GPU package, tensorflow only.
rocm/tensorflow-rocm | 1.10.0 | conda | linux-64 | h04cad3f_0, h7d95c5f_0
: Metapackage for selecting a TensorFlow variant.
sleap/tensorflow | 2.7.0 | conda | linux-64, win-64 | py36_0, py37h5685391_3, py37hb93dfd8_3, py37hb93dfd8_2, py37h5685391_2
: TensorFlow 2.7.0 conda package based on the PyPI wheels.
Also includes numpy 1.18.1, h5py 3.1.0 and opencv-python-headless 4.2.0.34.
For GPU support, install cudatoolkit 11.3.1 and cudnn 8.2.1 which are available as conda packages on the default channel.
Found 100 packages
Run 'anaconda show <USER/PACKAGE>' to get installation details
C:\Users\Lenovo>nvidia-smi
Mon May 02 16:08:18 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 442.23 Driver Version: 442.23 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 2060 WDDM | 00000000:01:00.0 On | N/A |
| N/A 45C P8 8W / N/A | 723MiB / 6144MiB | 8% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1572 C+G Insufficient Permissions N/A |
| 0 3800 C+G ...lugins\XWeb\628\extracted\WeChatApp.exe N/A |
| 0 4728 C+G ...dows.Cortana_cw5n1h2txyewy\SearchUI.exe N/A |
| 0 5528 C+G C:\Windows\explorer.exe N/A |
| 0 7800 C+G ...ns\XWeb\628\extracted\WechatBrowser.exe N/A |
| 0 8600 C+G ...cal\Programs\Microsoft VS Code\Code.exe N/A |
| 0 11120 C+G ...osoft.LockApp_cw5n1h2txyewy\LockApp.exe N/A |
| 0 12000 C+G ...gram Files (x86)\youdu\client\youdu.exe N/A |
| 0 12556 C+G ...DIA GeForce Experience\NVIDIA Share.exe N/A |
| 0 14384 C+G ...t_cw5n1h2txyewy\ShellExperienceHost.exe N/A |
| 0 15344 C+G ...hell.Experiences.TextInput.InputApp.exe N/A |
| 0 62404 C+G ...)\Microsoft\Edge\Application\msedge.exe N/A |
+-----------------------------------------------------------------------------+
所以需要选择cuda10.2版本的tensorflow,且显卡是Nvidia-Geforce RTX2060,系统为win64,tensorflow选择的包为:
conda-forge/tensorflow-estimator | 2.7.0 | conda | osx-arm64, linux-64, win-64, noarch, osx-64 | cuda112py310h922d117_0, py36h39e3cac_0, cuda112py38hab8ae04_2, cuda112py38hab8ae04_0, py37h5ca1d4c_0, pyh9656e83_0, cuda111py39h50553a9_1, cuda111py39h50553a9_0, cuda102py38h4357c17_2, cuda102py38h4357c17_0, cuda102py38h4357c17_1, pyh8a188c0_0, py39he80948d_0, cuda110py38h5f2c3e6_2, cuda110py39hf2ba822_2, cpu_py37h2b38087_1, py37hda21125_1, cpu_py37h2b38087_2, cuda110py39h016931e_1, cpu_py38h5f49c84_0, cpu_py37h2a13bee_0, cpu_py39h91c69d6_0, cuda112py39h23446aa_0, cpu_py37h2b38087_0, py38h5519746_0, py39h4ec10df_0, py37hfc69ec5_0, cpu_py38h1b4517c_0, cpu_py38h7d34d82_0, cpu_py38h7d34d82_2, cuda110py38h1096b06_1, cuda112py37h7d9f113_2, py27h24bf2e0_0, cpu_py38h4dea37b_0, cpu_py38h4dea37b_1, cpu_py38h4dea37b_2, py39h6f3a4d8_1, cuda110py310h4e8d1b5_0, py37h24bf2e0_0, pyh81a9013_1, py36hc4f0c31_0, py37he6ea403_1, py39he3720c4_1, cuda111py37hd477f92_2, cpu_py38h5f49c84_1, py36h24bf2e0_0, cpu_py38h5f49c84_2, py37hcd2ae1e_0, cuda112py39h23446aa_2, cpu_py310h9642b6f_0, py38h5ca1d4c_0, cpu_py310hd82aa13_0, cuda111py38h6ed5851_0, cuda110py38h09c20b0_0, py38hddd8853_0, cpu_py310hb7a2f4b_0, cuda110py37h41dd380_0, cuda111py38h7a887f1_2, cuda112py39heacc632_2, py39h9e04aea_0, cuda112py37h474db6c_2, cuda112py37h474db6c_0, cuda111py37h557cc93_1, cpu_py39h91c69d6_2, cpu_py39h91c69d6_1, cuda110py39h016931e_0, cuda111py38h862ebb2_1, cuda111py38h862ebb2_0, cuda110py37hae89d79_2, cpu_py37h559ea0e_0, cpu_py37h559ea0e_2, py36h5ca1d4c_0, cuda111py39h594ad97_0, cuda112py37hada678f_1, cuda112py37hada678f_0, cpu_py37h6f16af5_0, cpu_py37h6f16af5_2, cuda102py39h87695c4_1, cuda102py39h87695c4_0, cuda102py39h87695c4_2, py36h7641f05_0, cuda110py38h1096b06_0, py37h39e3cac_0, cuda110py39ha53fd0e_2, cuda110py39ha53fd0e_0, cuda111py37hf54207c_0, cuda111py39h594ad97_2, cuda111py39hbdafef0_2, cuda112py38hb2194ef_2, pyh3ac7371_0, cuda111py37hf54207c_2, cpu_py38hbed0dc1_2, cpu_py38hbed0dc1_1, cpu_py38hbed0dc1_0, cuda102py37had2b028_2, cuda110py37h4801193_0, cuda110py37h4801193_1, cpu_py39h1b7c303_2, cpu_py39h1b7c303_0, cpu_py39h1b7c303_1, cpu_py39ha241409_2, cuda110py37h41dd380_2, cpu_py39ha241409_0, py38hfbb78c2_1, cuda111py38h6ed5851_2, cuda102py37h80be449_2, cuda102py37h80be449_1, cuda102py37h80be449_0, py38h02c4698_1, pyh95af2a2_0, py38h709712a_0, cpu_py39hf4c5dbc_0, py39h6188115_1, cuda110py38h09c20b0_2, cuda111py37h557cc93_0, cuda102py38hb150450_2, cuda102py310hac962ef_0, cuda111py310h33dc607_0, cuda112py39h9333c2f_1, cuda112py39h9333c2f_0, cuda102py39h3630aa2_2, cuda112py38ha230376_1, cuda112py38ha230376_0, py38h45e38c2_1, cpu_py39h1b8f103_0, cpu_py39h1b8f103_1, cpu_py39h1b8f103_2, py27h5ca1d4c_0
(base) C:\Users\Lenovo>anaconda show conda-forge/tensorflow-estimator
Using Anaconda API: https://api.anaconda.org
Name: tensorflow-estimator
Summary: TensorFlow is an end-to-end open source platform for machine learning.
Access: public
Package Types: conda
Versions:
+ 1.13.0
+ 1.14.0
+ 2.2.0
+ 2.4.0
+ 2.5.0
+ 2.6.0
+ 2.6.2
+ 2.7.0
To install this package with conda run:
conda install --channel https://conda.anaconda.org/conda-forge tensorflow-estimator
conda list 查看当前环境已安装的包信息
conda list -n xxx #指定查看xxx虚拟环境下安装的package
conda search <package_name> 查询包信息
conda search <search_term> 模糊查询包信息
conda install <package_name> 安装包
conda install numpy scipy pandas 同时安装多个包
conda install numpy=1.10 安装包的指定版本
conda install anaconda 在当前环境安装anaconda集合包
conda uninstall xxx #卸载xxx文件包
conda update <package_name> 升级包
conda update conda 更新conda
conda update anaconda 更新anaconda
conda update python 更新Python
conda remove <package_name> 移除包
conda install --name <env_name> <package_name> 在指定环境安装的包信息
conda remove --name <env_name> <package_name> 移除指定环境的包
conda update --name <env_name> <package_name> 升级指定环境的包
conda list --name <env_name> 查看指定环境的已安装的包信息
conda install <package_name> 安装包
conda install numpy scipy pandas 同时安装多个包
conda install numpy=1.10 安装包的指定版本
conda install anaconda 在当前环境安装anaconda集合包
conda remove <package_name> 移除包
conda update <package_name> 升级包
conda list 查看当前环境已安装的包信息
conda search <package_name> 查询包信息
conda search <search_term> 模糊查询包信息
conda install --name <env_name> <package_name> 在指定环境安装的包信息
conda remove --name <env_name> <package_name> 移除指定环境的包
conda update --name <env_name> <package_name> 升级指定环境的包
conda list --name <env_name> 查看指定环境的已安装的包信息
conda update conda 更新conda
conda update anaconda 更新anaconda
conda update python 更新Python
conda clean就可以轻松搞定!第一步:通过conda clean -p来删除一些没用的包,这个命令会检查哪些包没有在包缓存中被硬依赖到其他地方,并删除它们。第二步:通过conda clean -t可以将conda保存下来的tar包。
conda clean -p //删除没有用的包
conda clean -t //tar打包
conda clean -y -all //删除所有的安装包及cache
conda install 软件时出现如下错误信息:
Preparing transaction: done
Verifying transaction: done
Executing transaction:
failed ERROR conda.core.link:_execute(502):
解决方法:往往时权限不够,需要以管理员方式运行Anaconda prompt进行安装
HTTP errors are often intermittent, and a simple retry will get you on your way. ConnectionError
这可能是防火墙问题,使用命令
conda config --set ssl_verify false
在Anaconda Prompt中通过“ conda env list”查看所有环境信息,确认环境所在目录;
注意:通过Conda创建的虚拟环境默认放置envs目录中,例如:“D:\DownLoadFiles\anaconda3\envs\mlcc”
打开Pycharm,然后依次点击File—》Settings—》Project:xxxxx—》Project Interperter—》“齿轮”按钮—》“Add Local…”
在出现页面中,添加Conda环境信息并保存
此时,依次点击File—》Settings—》Project:xxxxx—》Project Interperter—》“齿轮”按钮—》“Show All…”
依次点击File—》Settings—》Project:xxxxx—》Project Interperter,选择相应的环境。
(base) C:\Users\Lenovo>conda env list
# conda environments:
#
base * D:\install\Anaconda3
tensorflow D:\install\Anaconda3\envs\tensorflow
具体选择见第5章
(base) C:\Users\Lenovo>conda create --name conda_forge_tensorflow_estimator
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\install\Anaconda3\envs\conda_forge_tensorflow_estimator
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate conda_forge_tensorflow_estimator
#
# To deactivate an active environment, use
#
# $ conda deactivate
(base) C:\Users\Lenovo>conda activate conda_forge_tensorflow_estimator
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>coda list
'coda' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>conda list
# packages in environment at D:\install\Anaconda3\envs\conda_forge_tensorflow_estimator:
#
# Name Version Build Channel
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>conda install --channel https://conda.anaconda.org/conda-forge tensorflow-estimator
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\install\Anaconda3\envs\conda_forge_tensorflow_estimator
added / updated specs:
- tensorflow-estimator
The following packages will be downloaded:
package | build
---------------------------|-----------------
absl-py-1.0.0 | pyhd8ed1ab_0 95 KB conda-forge
astor-0.8.1 | pyh9f0ad1d_0 25 KB conda-forge
bzip2-1.0.8 | h8ffe710_4 149 KB conda-forge
ca-certificates-2021.10.8 | h5b45459_0 176 KB conda-forge
gast-0.5.3 | pyhd8ed1ab_0 20 KB conda-forge
intel-openmp-2022.0.0 | h57928b3_3663 3.6 MB conda-forge
libblas-3.9.0 | 14_win64_mkl 5.3 MB conda-forge
libcblas-3.9.0 | 14_win64_mkl 5.3 MB conda-forge
libffi-3.4.2 | h8ffe710_5 41 KB conda-forge
liblapack-3.9.0 | 14_win64_mkl 5.3 MB conda-forge
libprotobuf-3.20.0 | h7755175_0 2.4 MB conda-forge
libzlib-1.2.11 | h8ffe710_1014 64 KB conda-forge
mkl-2022.0.0 | h0e2418a_796 181.9 MB conda-forge
numpy-1.22.3 | py310hed7ac4c_2 6.1 MB conda-forge
openssl-3.0.2 | h8ffe710_1 10.1 MB conda-forge
pip-22.0.4 | pyhd8ed1ab_0 1.5 MB conda-forge
protobuf-3.20.0 | py310h5588dad_4 239 KB conda-forge
python-3.10.4 |hcf16a7b_0_cpython 16.2 MB conda-forge
python_abi-3.10 | 2_cp310 4 KB conda-forge
setuptools-62.1.0 | py310h5588dad_0 1.3 MB conda-forge
six-1.16.0 | pyh6c4a22f_0 14 KB conda-forge
sqlite-3.38.3 | h8ffe710_0 1.3 MB conda-forge
tbb-2021.5.0 | h2d74725_1 148 KB conda-forge
tensorflow-estimator-2.5.0 | pyh81a9013_1 289 KB conda-forge
termcolor-1.1.0 | py_2 6 KB conda-forge
tk-8.6.12 | h8ffe710_0 3.5 MB conda-forge
tzdata-2022a | h191b570_0 121 KB conda-forge
ucrt-10.0.20348.0 | h57928b3_0 1.2 MB conda-forge
vc-14.2 | hb210afc_6 13 KB conda-forge
vs2015_runtime-14.29.30037 | h902a5da_6 1.3 MB conda-forge
wheel-0.37.1 | pyhd8ed1ab_0 31 KB conda-forge
wrapt-1.14.0 | py310he2412df_1 49 KB conda-forge
xz-5.2.5 | h62dcd97_1 211 KB conda-forge
zlib-1.2.11 | h8ffe710_1014 106 KB conda-forge
------------------------------------------------------------
Total: 247.8 MB
The following NEW packages will be INSTALLED:
absl-py conda-forge/noarch::absl-py-1.0.0-pyhd8ed1ab_0
astor conda-forge/noarch::astor-0.8.1-pyh9f0ad1d_0
bzip2 conda-forge/win-64::bzip2-1.0.8-h8ffe710_4
ca-certificates conda-forge/win-64::ca-certificates-2021.10.8-h5b45459_0
gast conda-forge/noarch::gast-0.5.3-pyhd8ed1ab_0
intel-openmp conda-forge/win-64::intel-openmp-2022.0.0-h57928b3_3663
libblas conda-forge/win-64::libblas-3.9.0-14_win64_mkl
libcblas conda-forge/win-64::libcblas-3.9.0-14_win64_mkl
libffi conda-forge/win-64::libffi-3.4.2-h8ffe710_5
liblapack conda-forge/win-64::liblapack-3.9.0-14_win64_mkl
libprotobuf conda-forge/win-64::libprotobuf-3.20.0-h7755175_0
libzlib conda-forge/win-64::libzlib-1.2.11-h8ffe710_1014
mkl conda-forge/win-64::mkl-2022.0.0-h0e2418a_796
numpy conda-forge/win-64::numpy-1.22.3-py310hed7ac4c_2
openssl conda-forge/win-64::openssl-3.0.2-h8ffe710_1
pip conda-forge/noarch::pip-22.0.4-pyhd8ed1ab_0
protobuf conda-forge/win-64::protobuf-3.20.0-py310h5588dad_4
python conda-forge/win-64::python-3.10.4-hcf16a7b_0_cpython
python_abi conda-forge/win-64::python_abi-3.10-2_cp310
setuptools conda-forge/win-64::setuptools-62.1.0-py310h5588dad_0
six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
sqlite conda-forge/win-64::sqlite-3.38.3-h8ffe710_0
tbb conda-forge/win-64::tbb-2021.5.0-h2d74725_1
tensorflow-estima~ conda-forge/noarch::tensorflow-estimator-2.5.0-pyh81a9013_1
termcolor conda-forge/noarch::termcolor-1.1.0-py_2
tk conda-forge/win-64::tk-8.6.12-h8ffe710_0
tzdata conda-forge/noarch::tzdata-2022a-h191b570_0
ucrt conda-forge/win-64::ucrt-10.0.20348.0-h57928b3_0
vc conda-forge/win-64::vc-14.2-hb210afc_6
vs2015_runtime conda-forge/win-64::vs2015_runtime-14.29.30037-h902a5da_6
wheel conda-forge/noarch::wheel-0.37.1-pyhd8ed1ab_0
wrapt conda-forge/win-64::wrapt-1.14.0-py310he2412df_1
xz conda-forge/win-64::xz-5.2.5-h62dcd97_1
zlib conda-forge/win-64::zlib-1.2.11-h8ffe710_1014
Proceed ([y]/n)? y
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>conda install opencv-python
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:
- opencv-python
Current channels:
- 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.
解决方法是使用pip安装
(conda_forge_tensorflow_estimator) C:\Users\Lenovo>pip install opencv-python
Collecting opencv-python
Downloading opencv_python-4.5.5.64-cp36-abi3-win_amd64.whl (35.4 MB)
---------------------------------------- 35.4/35.4 MB 10.7 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17.3 in d:\install\anaconda3\envs\conda_forge_tensorflow_estimator\lib\site-packages (from opencv-python) (1.22.3)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.5.5.64