【问题标题】:Installed Python Module with Pip but Cannot Import [duplicate]使用 Pip 安装 Python 模块但无法导入 [重复]
【发布时间】:2017-03-24 22:59:00
【问题描述】:

Python 3.4

Windows 7 企业版

Anaconda3

Spyder 3.0.1

我正在尝试安装 beautifulsoup4,它成功了。它的原始安装文件夹中只有文本文件并且没有导入。

这是我删除原始文件夹后 pip 安装的图片,其中只有文本文件——没有轮子或 py 文件。

pip install image

它也在已安装的模块列表中。但是在尝试导入时...

我收到这条消息:

import beautifulsoup4
Traceback (most recent call last):

File "<ipython-input-16-7e3d2e2a3c50>", line 1, in <module>
 import beautifulsoup4>

ImportError: No module named 'beautifulsoup4'

顺便说一句,我正在 Spyder 中运行上述脚本。

我已经检查了我的 PYTHONPATH 管理器并且有

C:/.../Lib/site-packages 

在那里,不知道我哪里出错了。

【问题讨论】:

  • BeautifulSoup 安装为 bs4,而不是 beautifulsoup4

标签: windows python-3.x anaconda enterprise spyder


【解决方案1】:

尝试使用 bs4 进行导入。如果您还没有,请确保重新启动 cmd。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-23
    相关资源
    最近更新 更多