Py2exe doesn't find bs4

后端 未结 1 673
故里飘歌
故里飘歌 2021-01-28 04:42

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:

相关标签:
1条回答
  • 2021-01-28 05:06

    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)
    
    0 讨论(0)
提交回复
热议问题