无法导入正确安装模块的名称模块 [英] cannot import name module with module correctly installed

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

问题描述

python 中的新内容.我有 python 2.7.我刚刚在 Windows 7 中从 cmd 安装了一个新模块 (beatifulsoup),该模块已正确安装:当我从 cmd 输入 python consol 时,我可以成功导入 bs4,没有错误.我的问题是我在使用 Aptana studio 时无法导入它.或者,如果我在 sublimetext 中对其进行编码并将其保存为 py 文件,当我运行它时,我会收到错误消息无法导入名称 beautifulsoup 4".我不明白为什么?是aptana上pydev环境的问题吗?如果是,我如何向 Aptana 和 sublimetext3 添加模块?

new in python. I have python 2.7. I just installed a new module (beatifulsoup) from cmd in windows 7 which is correctly installed : When I enter the python consol from the cmd I can import succesfully bs4 without error. My problem is that I cannot import it when I am using Aptana studio. Or if I code it in sublimetext and save it as a py file, when I run it I get the error message "cannot import name beautifulsoup 4". I don't get why? Is it a problem of pydev environment on aptana? If yes how can I add modules to Aptana and sublimetext3 ?

推荐答案

您是否尝试像这样导入:

Are you trying to import like this:

从 bs4 导入 BeautifulSoup

如果没有,就这样试试.希望这会有所帮助!

If not, try it that way. Hope this helps!

(也许您应该将导入语句添加到问题中,以便我们可以查看该语句是否存在问题,或者问题是否存在于其他地方)

(Perhaps you should add your import statement to the question so we can see if there is a problem with the statement or if the issue resides somewhere else)

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

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