一、Traceback (most recent call last): File "D:\File\PycharmProjects\Test\main.py", line 5, in <module> import numpy as np ModuleNotFoundError: No module named 'numpy'
1.卸载
pip uninstall numpy
2.安装
直接到需要安装的路径,右键打开终端
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
安装任何需要的库,都可以用https://pypi.tuna.tsinghua.edu.cn/simple
只需要将 库名 替换
比如:tensorflow
pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple
python 安装numpy,matplotlib 清华源快速安装_numpy清华源_Vertira的博客-CSDN博客
(初学者NumPy 、SciPy、matplotlib库安装及sklearn的安装_Sunshine_502的博客-CSDN博客)
(python安装numpy、matplotlib和scipy的方法 - 知乎)
(python|如何使用pip安装、卸载、更新第三方模块 - 知乎)
二、FileNotFoundError: [Errno 2] No such file or directory: 'iris.csv'
import csv
# 定义文件路径
csv_path = 'C:/Users/Xu/Desktop/iris.csv' //改为自己文件所在的绝对路径
df_full = pd.read_csv(csv_path) //原来是df_full = pd.read_csv("iris.c0sv")