Frage

In my original code, I have the line:

from bs4 import BeautifulSoup

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

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

I specifically put bs4 in the py2exe options:

"includes": ["bs4.BeautifulSoup"]

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

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.

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

easy_install --always-unzip beautifulsoup4

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

War es hilfreich?

Lösung

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.

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)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top