参考文献:
https://github.com/Prinsphield/Wechat_AutoJump
https://zhuanlan.zhihu.com/p/32636329
1、安装python 环境,推荐安装Anaconda,下载地址:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda
1)下载了32位的Anaconda,安装完成后在cmd中输入conda不是内部命令,于是手动设置了系统环境变量:
C:\platform-tools;C:\Users\Administrator\Anaconda3\Scripts
C:\Users\Administrator>conda
usage: conda [-h] [-V] command ...
2)配置免费仓库:
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 --set show_channel_urls yes
3)安装numpy
C:\Users\Administrator>conda install numpy
Fetching package metadata .................
Solving package specifications: .
Package plan for installation in environment C:\Users\Administrator\Anaconda3:
The following packages will be UPDATED:
anaconda: 5.0.1-py36h2419598_2 defaults --> custom-py36h8b40cde_0 https://
mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda: 4.3.30-py36h404fb56_0 defaults --> 4.4.7-py36_0 https://
mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pycosat: 0.6.2-py36h06ed0df_1 defaults --> 0.6.3-py36hbfdb8c3_0 https://
mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
The following packages will be SUPERSEDED by a higher-priority channel:
conda-env: 2.6.0-h36134e3_1 defaults --> 2.6.0-h36134e3_1 https://
mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
numpy: 1.13.3-py36h38e73f1_0 defaults --> 1.13.3-py36h38e73f1_0 https://
mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
Proceed ([y]/n)?
conda-env-2.6. 100% |###############################| Time: 0:00:00 668.47 kB/s
anaconda-custo 100% |###############################| Time: 0:00:00 1.57 MB/s
numpy-1.13.3-p 100% |###############################| Time: 0:00:00 5.29 MB/s
pycosat-0.6.3- 100% |###############################| Time: 0:00:00 9.57 MB/s
conda-4.4.7-py 100% |###############################| Time: 0:00:00 8.15 MB/s
到此安装完毕。
3)安装cv2
conda install opencv
3)安装TensorFlow
参考:https://www.cnblogs.com/willnote/p/6746499.html
a、搜索当前可用的tensorflow版本,选择一个适合的版本
anaconda search -t conda tensorflow > tensorflowsouce.txt
由于是win7 32位环境,于是选择了 r/r-tensorflow
r/r-tensorflow | 1.4 | conda | linux-64, win-32, win-64, linux-32, osx-64 | py36r3.4.1_0, r342h38ebd79_0, r342h0e1eca8_0, r342hd3d5cfb_0, r342h0bf44f9_0, r3.4.1_0, r342h935e3b1_0
b、查看选定的版本下载方法
anaconda show r/r-tensorflow
To install this package with conda run:
conda install --channel https://conda.anaconda.org/r r-tensorflow
c、开始下载
conda install --channel https://conda.anaconda.org/r r-tensorflow
安装不成功
2、寻找其他的方法:
http://blog.csdn.net/u010858605/article/details/64128466
http://blog.csdn.net/chewinggum/article/details/70373098
1)创建tensorflow环境
TensorFlow目前在Windows下只支持Python 3.5版本。
(tensorflow) C:\Users\Administrator>conda create -n tensorflow python=3.5
2)启动tensorflow环境
(tensorflow) C:\Users\Administrator>activate tensorflow
'chcp' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
解决方法:系统变量path值中添加上C:\Windows\system32就好了
4)安装TensorFlow
pip install --upgrade --ignore-installed tensorflow
在这个网站看当前TensorFlow支持的python版本和windows版本。
https://pypi.python.org/pypi/tensorflow/1.1.0rc2
从这例看到,TensorFlow不支持win7-32位系统,没有对应的安装包。由于我的笔记本是win7-32位
所以果断换我的PC win7-64系统重新安装。
5)解决报错:
ImportError: No module named cv2 报错处理
在安装opevncv时会出现 ImportError: No module named cv2 的错误,找不到cv2的包。
这时候安装扩展包即可:
pip install opencv-python