一、在指定目录安装python第三方库
–target=D:\software\anaconda\envs\PyTorch\Lib
这里的target后面跟的是你python安装环境的lib目录
二、用指定源安装python库
这里用到了-i 如:使用清华源安装py2neo
pip install py2neo -i https://pypi.tuna.tsinghua.edu.cn/simple/
国内常用的源
阿里云: https://mirrors.aliyun.com/pypi/simple/
豆瓣: http://pypi.douban.com/simple/
清华大学: https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学: http://pypi.mirrors.ustc.edu.cn/simple/
三、两种方式可以结合一下
pip install py2neo -i https://pypi.tuna.tsinghua.edu.cn/simple/ --target=D:\software\anaconda\envs\PyTorch\Lib