如何在VSCode中配置NumPy环境并验证有效性(2023.3.19)

1.首先找到python.exe文件的位置

查看python.exe文件在哪的方法:

1、在vscode中执行下面的程序即可直接输出python.exe文件的路径

import sys
sys.executable

输出结果如下:

 C:\Users\胡萝卜超爱兔子\AppData\Local\Programs\Python\Python310

2、新建终端

然后输入下列进行跳转

cd C:\Users\胡萝卜超爱兔子\AppData\Local\Programs\Python\Python310

3、按道理来说此时输入下列的代码就可以安装了,但是但是,安的太慢了

pip install numpy

所以我们考虑使用国内镜像资源

目前,比较常用的pip镜像站点有:

1)清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/

2)中科大:https://mirrors.ustc.edu.cn/pypi/web/simple/

3)豆瓣:http://pypi.doubanio.com/simple/

4)阿里云:http://mirrors.aliyun.com/pypi/simple/

直接在pip install numpy 后加上镜像源地址,即

pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/

大功告成,功成身退!!!

物联沃分享整理
物联沃-IOTWORD物联网 » 如何在VSCode中配置NumPy环境并验证有效性(2023.3.19)

发表评论