按照以下步骤操作:
第一步
创建txt文件,加入命名为requirements.txt
第二步
将需要安装的包写入txt文件中,写入的方式如下
可以根据需要注明版本,解决对于版本的要求。
第三步
cmd或者从anaconda 的命令行中中进入txt文件所在路径下,运行下面的命令行即可:
1)不采用镜像的方式,命令行如下:
pip install -r requirements.txt
2)采用镜像的方式,命令行如下:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
其中,比较常用的国内镜像包括:
(1)阿里云 http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣http://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/