1、创建终端,类似于本地CMD
输入:python -m pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
使用清华镜像安装速度更快。
2、进入VScode目录下,Python的Scripts文件夹,注意双引号
cd "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\Scripts"
ps:关于目录的获取,随便输入一个命令运行,报错时会提醒
3、使用pip安装库,例如Scrapy包,注意.\
.\pip install Scrapy
4、报错解决
报错:
Failed cleaning build dir for cryptography
Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
是因为pip问题
或者此链接ERROR: Failed cleaning build dir for cryptography (mac环境)_cuishao-CSDN博客
5、查看是否安装成功
.\pip list