Spyder模块导入 [英] Spyder Module Import

查看:754
本文介绍了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?

推荐答案

这就是你需要做的事情:

This is what you need to do:


  1. 打开终端并运行 python ipython

执行这两个命令:

import sys

sys.executable

复制最后一个命令的输出

Copy the output of the last command

打开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).

最后转到口译员>打开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天全站免登陆