(2023.3.19)vscode配置numpy环境,实测有效

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

扫描二维码关注公众号,回复: 16982657 查看本文章

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/

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

猜你喜欢

转载自blog.csdn.net/m0_67227361/article/details/129658260