Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't create exe-file with this module #31587

Closed
@PeterBan11

Description

@PeterBan11

Describe the bug

from sklearn.neighbors import NearestNeighbors

--hidden-import=sklearn.neighbors

File "C:\Python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2537, in _scan_bytecode
    for inst in util.iterate_instructions(module_code_object):
  File "C:\Python\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 13, in iterate_instructions
    yield from (i for i in dis.get_instructions(code_object) if i.opname != "EXTENDED_ARG")
  File "C:\Python\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 13, in <genexpr>
    yield from (i for i in dis.get_instructions(code_object) if i.opname != "EXTENDED_ARG")
  File "C:\Python\lib\dis.py", line 338, in _get_instructions_bytes
    argval, argrepr = _get_const_info(arg, constants)
  File "C:\Python\lib\dis.py", line 292, in _get_const_info
    argval = const_list[const_index]
IndexError: tuple index out of range

Project output will not be moved to output folder

Steps/Code to Reproduce

from sklearn.neighbors import NearestNeighbors
points = np.array([[pt.x, pt.y, pt.z] for pt in face_centers])
if len(points) < 2:
      return 0
nbrs = NearestNeighbors(n_neighbors=2, algorithm='auto').fit(points)

Expected Results

I expected to create exe-file with this module imported using pyInstaller

Actual Results

File "C:\Python\lib\dis.py", line 292, in _get_const_info
    argval = const_list[const_index]
IndexError: tuple index out of range

Project output will not be moved to output folder

Versions

sklearn: 1.4.2
          pip: 21.3.1
   setuptools: 60.2.0
        numpy: 1.26.4
        scipy: 1.15.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions