Py2exe does not find bs4

In my source code, I have a line:

from bs4 import BeautifulSoup

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

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

I specifically put bs4 in the py2exe option:

"includes": ["bs4.BeautifulSoup"]

How should I refer to BeautifulSoup in an include statement? Fella didn’t know how to do it here: Third-party libraries and Py2exe

Do I need to use packages instead of inclusions or something else? All ordinary libraries and some others, such as mechanization, import in order, but I can not get BeautifulSoup to work fine. Any advice is appreciated.

EDIT: I solved some of this by uninstalling BeautifulSoup and reinstalling with the -allways-unzip option:

easy_install --always-unzip beautifulsoup4

However, he added 9 new missing modules. One of them is "_scproxy".

0
1

, , setup.py , , .

, setup.py:

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

Source: https://habr.com/ru/post/1569885/


All Articles