pyinstaller / pyinstaller

Freeze (package) Python programs into stand-alone executables
http://www.pyinstaller.org
Other
11.89k stars 1.94k forks source link

Pyinstaller cannot import name 'ImageToTextTask' from 'python3_anticaptcha' #4534

Closed cypri99 closed 4 years ago

cypri99 commented 4 years ago

Hello, I am trying to compile my application but I have this issue and don't know how to go about it. I read the docs and tried to add it in my main spec but I still got issue with it. My application has a main file that runs this run.py file which will run eiter one 30 scripts depending on the user's choice. Here's my spec file

block_cipher = None

added_files = [
         ('pyinstaller_assets/license.lic', '.'), 
         ('pyinstaller_assets/_pytransform.dll', '.'),
         ('pyinstaller_assets/pytransform.key', '.'),
         ('pyinstaller_assets/pytransform.py', '.'),
         ('config/*.txt', 'config' ),
         ('config/accounts/*.txt', 'config/accounts' ),
         ('config/log/*.txt', 'config/log' ),
         ('config/instagram/*.txt', 'config/instagram' ),
         ('config/images/*.txt', 'config/images' ),
         ('config/verification/*.txt', 'config/verification' ),
         ('static/*.py', 'static'),
         ('scripts/*.py', 'scripts'),
         ('helpers/*.py', 'helpers'),
         ('config/*.py', 'config'),
         ('config/config.yaml', '.'),
         ('run.py', '.'),
         ]

a = Analysis(['main.py'],
             pathex=['.'],
             binaries=[],
             datas=added_files,
             hiddenimports=['beautifulsoup4', 'cloudscraper', 'colorama', 'coloredlogs', 'dhooks', 'fake_useragent', 'faker', 'js2py', 'lxml', 'names', 'ntplib', 'polling', 'psutil', 'python3_anticaptcha', 'python_anticaptcha', 'pytz', 'yaml', 'pyyaml', 'requests', 'verboselogs'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name='main',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          runtime_tmpdir=None,
          console=True )
cypri99 commented 4 years ago

Fixed it, I really had to add all the path of every packages that pyinstaller couldn't find