【问题标题】:Module can be imported in the terminal, but not IDLE模块可以在终端中导入,但不能在 IDLE 中导入
【发布时间】:2019-01-24 00:23:18
【问题描述】:

最近在使用pip安装python模块时,在IDLE中运行时会报错说模块没有下载。但是,当我在终端中运行相同的脚本时,它工作正常。这是什么错误,我该如何解决?

Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    import gspread
ModuleNotFoundError: No module named 'gspread'

【问题讨论】:

标签: python macos terminal


【解决方案1】:

可能您安装了不同版本的 python。 您使用 pip 安装新模块的版本与您使用 IDLE 访问的版本不同。

【讨论】:

  • 我不想要的版本如何删除?
  • 取决于您要删除的版本或该版本的安装方式。如果是 MacOS 并且你要删除的版本是 python2.7 你不想删除它,它是 MacOS 的一部分。
猜你喜欢
  • 1970-01-01
  • 2018-08-27
  • 2018-02-09
  • 2013-04-17
  • 2011-12-19
  • 2017-02-11
相关资源
最近更新 更多