Spyder 模块导入 [英] Spyder Module Import

查看:33
本文介绍了Spyder 模块导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Spyder.app 中导入 cv2 模块,但不知何故它没有导入.顺便说一下,我可以在终端中导入它.你们中的任何人都可以帮我吗?

I am trying to import cv2 module in Spyder.app but somehow it does not import. By the way I am able to import it in a terminal. Can anyone of you guys please help me?

推荐答案

这是你需要做的:

  1. 打开终端并运行 pythonipython.

在那里执行这两个命令:

In there execute these two commands:

导入系统

sys.executable

复制上一条命令的输出

打开 Spyder 并转到

Open Spyder and go to

Spyder >首选项 >控制台 >高级设置Python 可执行文件

选择选项

使用下面的Python解释器

并粘贴第 3 步的结果(此选项仅在 Spyder 2.2.3 或更新版本中可用).

and paste there the result of step 3 (this option is only available in Spyder 2.2.3 or newer).

最后去Interpreters >打开 Python 解释器.这将打开一个新控制台,该控制台将运行您在终端中使用的相同 Python 版本.

Finally go to Interpreters > Open a Python interpreter. This will open a new console that will be running the same Python version that you use in a terminal.

这篇关于Spyder 模块导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆