场景:
去github上star了一个程序后准备在本地复现
仓库地址:https://github.com/albertbup/deep-belief-network.git
实现过程:
clone 的时候出现连接超时的情况,把https改成git
clone git://github.com/albertbup/deep-belief-network.git
clone成功后在本地出现一个名为deep-belief-network的文件夹
进入文件夹里:
cd deep-belief-network
安装virtualenv:
pip install virtualenv
创建虚拟环境并指定PYTHON版本,这里要注意电脑里必须提前安装好Python3.6
virtualenv venv --python=python3.6
根据项目里的需求,安装所需包(requirements.txt)
pip install -r requirements.txt
在安装tensorflow的过程中出现如下报错(wrapt卸载失败):
ERROR: Cannot uninstall ‘wrapt’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
手动pip uninstall 也不行
查找资料后写:
pip install -U --ignore-installed wrapt enum34 simplejson netaddr
然后再次安装:
pip install tensorflow==1.15.0
这次成功。
最后就可以美美地复现程序啦!