1.最新版anaconda3都自带python3.10版本,但只想用python3.8版本,所以要找最后python3.8的anconda3版本安装。进过多次下载试安装,确定为Anaconda3 2021.05 windows -x86_64版本
添加清华镜像源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
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/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/
conda config --show channels
或者在
C:\Users\chenxi\.condarc文件里直接加入
删除--default据说可以加速,不知道是不是真的
2.安装opencv
conda install -c conda-forge opencv
Solving environment: /一直卡在这里下不去
只能换用这种方式:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
2.安装tensorflow,官网直接下载
tensorflow_cpu-2.6.0-cp38-cp38-win_amd64.whl包安装
3.安装其他一些要用的库
pip install pynvml
pip install reportlab
pip install pdfrw
pip install filterpy
出现:
cannot import name ‘dtensor’ from 'tensorflow.compat.v2.experimental’报错
环境 cuda11.2 tensorflow2.6 python 3.9
报错是因为keras版本太高,需要降低到和tensorflow版本一致,pip install keras==2.6,降低keras版本就好了。
4. 安装pyinstaller并使用:
#应该把“D:\anaconda3\envs\xxxx\Library\bin”添加到环境变量中
#anconda3虽然内部已安装scikit-learn,pyqt5,但奇怪的是在pyinstaller时还是提示一些错误,重新安装即可;
pyinstaller打包好后的应用程序有1.98个G
-----------------------------------------------------------------------
纯安装实现:
1.python官网下载3.8.10版本,其他竟然没有3.8.13的安装包
2.清华共享源下载opencv,tensorflow,pyqt5的whl包安装
3.余下的用pip安装
pip install pyfilter
pip install pyyaml
pip install psutil
pip install qt_material
python程序运行时提示**410.dll库找不到,需要去微软网站下载VC_redist_x64.exe安装包安装
4.安装pyinstaller,并打包,应用程序有1.08个G