为了开发环境纯净,应该首先创建虚拟环境
mkvirtualenv -p python3 虚拟环境名称
如,mkvirtualenv -p python3 ai
但是有的童鞋会卡在这一步,会报一个这样的错误:
OSError: Command /home/python/.virtualenvs/ai/bin/python3 - setuptools pkg_resources pip wheel failed with error code 2
这是因为virtualenv虚拟环境----pip多版本共存导致的
解决办法可以看这个帖子:https://blog.csdn.net/dashen180309/article/details/79494016
接下来再说如何配置机器学习的开发环境
首先建一个txt文件,名字随意,比如, bao.txt
里面写上:
matplotlib==2.0.2
numpy==1.14.2
pandas==0.20.3
TA-Lib==0.4.16
tables==3.4.2
jupyter==1.0.0
然后根据在上面创建好的虚拟环境中进行安装,
进入虚拟环境的命令: workon 两次tab键
workon 虚拟环境名称(首次创建默认是在虚拟环境中的)
如
workon ai
退出虚拟环境的命令:deactivate
删除虚拟环境的命令:rmvirtualenv 虚拟环境名称
在虚拟环境安装各种机器学习包的命令:
pip install -r bao.txt(就是上面写下各个包的txt文档)
以上就是机器学习入门需要的包,后面再更新
深度学习部分:
TensorFlow的安装
CPU版本
pip install tensorflow==1.8 -i https://mirrors.aliyun.com/pypi/simple
或
pip install tensorflow==1.8 -i https://mirrors.aliyun.com/pypi/simple
GPU版本
https://www.tensorflow.org/install/install_linux