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

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

问题描述

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 ?

推荐答案

您是否要像这样导入:

从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天全站免登陆