【机器学习】Traceback (most recent call last): File “<input>“, line 1, in <module> File “D:\JetBrains\

报错

Traceback (most recent call last):
  File "", line 1, in <module>
  File "D:\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "D:\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "F:\2022\机器学习\learn\1_4\learnNumpy.py", line 1, in <module>
    import numpy as np
  File "D:\JetBrains\PyCharm 2019.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'numpy'

大概是之前下载了半天也没下载上……

解决方法

我用的是pycharm

  1. 打开file->settings
    【机器学习】Traceback (most recent call last): File “<input>“, line 1, in <module> File “D:\JetBrains\_第1张图片

  2. 点击Project:xx/project interpreter,双击pip
    【机器学习】Traceback (most recent call last): File “<input>“, line 1, in <module> File “D:\JetBrains\_第2张图片
    3.在搜索框搜索然后下载
    【机器学习】Traceback (most recent call last): File “<input>“, line 1, in <module> File “D:\JetBrains\_第3张图片

  3. 如果速度太慢可以添加https://pypi.douban.com/simple
    【机器学习】Traceback (most recent call last): File “<input>“, line 1, in <module> File “D:\JetBrains\_第4张图片

你可能感兴趣的:(机器学习,机器学习,python,人工智能)