Py2exe没有找到BS4 [英] Py2exe doesn't find bs4

查看:455
本文介绍了Py2exe没有找到BS4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我原来的code,我也行:

In my original code, I have the line:

from bs4 import BeautifulSoup

当我用py2exe,它建立罚款,但进一步向上输出它说:

When I use py2exe, it builds fine but further up in the output it says:

The following modules appear to be missing
['_scproxy', 'bs4']

我专门整理BS4在py2exe选项:

I specifically put bs4 in the py2exe options:

"includes": ["bs4.BeautifulSoup"]

是我应该如何中引用BeautifulSoup了包括声明?
在这里的小伙子不知道该怎么办,要么:第三方库和Py2exe

Is that how I should be referencing BeautifulSoup in the includes statement? The fella over here didn't know how to do it either: 3rd Party Libraries and Py2exe

我需要用的包,而不是包括什么?所有常规库和其他一些像机械化进口罚款,但我不能让BeautifulSoup做工精细。任何的建议是AP preciated。

Do I need to use packages instead of includes or something? All regular libraries and some other like mechanize import fine, but I can't get BeautifulSoup to work fine. Any advice is appreciated.

编辑:我被卸载BeautifulSoup和--always-解压选项重新安装解决了这一部分:

I solved part of this by uninstall BeautifulSoup and re-installing with --always-unzip option:

easy_install --always-unzip beautifulsoup4

然而,它增加了9个新的失踪模块。一个是_scproxy。

However, it added 9 new missing modules. One being '_scproxy'.

推荐答案

要检查的第一件事是,你有你的 setup.py 同一目录的为你的模块和您从运行它的该目录

First thing to check is that you have your setup.py in the same directory as your module and your are running it from that directory.

如果不工作,你应该将模块添加到您的路径中的 setup.py

If that doesn't work your should add your module to your path in setup.py:

module_path = r'path\to\your\BeautifulSoup\module'
if module_path not in sys.path:
    sys.path.append(modules_path)

这篇关于Py2exe没有找到BS4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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