Search code examples
python-3.xpyinstallergevent

Python, pyinstaller raised an error as follows


when I ran the application, it raised error as follows. My python version is 3.8.10 and pyinstaller version is 4.4. How to deal with it?

Traceback (most recent call last):
  File "run.py", line 360, in huaban.run.MainWorkPanel.start_download
  File "run.py", line 594, in huaban.run.MainWorkPanel.real_run
  File "scrapy\crawler.py", line 280, in __init__
  File "scrapy\crawler.py", line 152, in __init__
  File "scrapy\crawler.py", line 146, in _get_spider_loader
  File "scrapy\spiderloader.py", line 67, in from_settings
  File "scrapy\spiderloader.py", line 24, in __init__
  File "scrapy\spiderloader.py", line 51, in _load_all_spiders
  File "scrapy\utils\misc.py", line 83, in walk_modules
  File "C:\soft\VirtualenvFiles\huaban\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py", line 71, in _pyi_pkgutil_iter_modules
    assert pkg_path.startswith(SYS_PREFIX)
TypeError: startswith first arg must be str or a tuple of str, not PureWindowsPath

Solution

  • Fixed in PyInstaller 4.5.

    See here.