kandi background
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
Explore all Caching open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Caching

3.0.6

v3.0.2

v1.2.1

v5.4.7

caffeine

3.0.6

bigcache

v3.0.2

freecache

v1.2.1

cache

v5.4.7

jetcache

Popular Libraries in Caching

Trending New libraries in Caching

Top Authors in Caching

1

19 Libraries

643

2

10 Libraries

679

3

8 Libraries

128

4

7 Libraries

175

5

7 Libraries

38

6

7 Libraries

348

7

7 Libraries

77

8

6 Libraries

551

9

6 Libraries

64

10

6 Libraries

41

1

19 Libraries

643

2

10 Libraries

679

3

8 Libraries

128

4

7 Libraries

175

5

7 Libraries

38

6

7 Libraries

348

7

7 Libraries

77

8

6 Libraries

551

9

6 Libraries

64

10

6 Libraries

41

Trending Kits in Caching

No Trending Kits are available at this moment for Caching

Trending Discussions on Caching

    IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe
    Display customer specific information on product detail page - what about the caching?
    Netlify says, "error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0)"โ€”yet I have the newest Node version?
    Unable to build and deploy Rails 6.0.4.1 app on heroku - Throws gyp verb cli error
    How can I dynamically allocate cyclic data?
    Command failed with exit code 134: npm run generate
    CircleCI (Started 11/1/2021) Canโ€™t find Python executable โ€œpythonโ€, you can set the PYTHON env variable
    how to change create-react-app PWA to network-first
    Does .NET Framework have an OS-independent global DNS cache?
    Spark "first" Window function is taking much longer than "last"

QUESTION

IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe

Asked 2022-Feb-24 at 15:03

I have been trying out an open-sourced personal AI assistant script. The script works fine but I want to create an executable so that I can gift the executable to one of my friends. However, when I try to create the executable using the auto-py-to-exe, it states the below error:

1Running auto-py-to-exe v2.10.1
2Building directory: C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
3Provided command: pyinstaller --noconfirm --onedir --console --no-embed-manifest  "C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py"
4Recursion Limit is set to 5000
5Executing: pyinstaller --noconfirm --onedir --console --no-embed-manifest C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py --distpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\application --workpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\build --specpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
6
742681 INFO: PyInstaller: 4.6
842690 INFO: Python: 3.10.0
942732 INFO: Platform: Windows-10-10.0.19042-SP0
1042744 INFO: wrote C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec
1142764 INFO: UPX is not available.
1242772 INFO: Extending PYTHONPATH with paths
13['C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310']
1443887 INFO: checking Analysis
1543891 INFO: Building Analysis because Analysis-00.toc is non existent
1643895 INFO: Initializing module dependency graph...
1743915 INFO: Caching module graph hooks...
1843975 INFO: Analyzing base_library.zip ...
1954298 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2054306 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib'
2157474 INFO: Caching module dependency graph...
2258088 INFO: running Analysis Analysis-00.toc
2358132 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
24  required by C:\Users\Tarun\AppData\Local\Programs\Python\Python310\python.exe
2558365 INFO: Analyzing C:\Users\Tarun\AppData\Local\Programs\Python\Python310\AI_Ass.py
2659641 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
27An error occurred while packaging
28Traceback (most recent call last):
29  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
30    run_pyinstaller()
31  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 124, in run
32    run_build(pyi_config, spec_file, **vars(args))
33  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
34    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
35  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
36    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
37  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
38    exec(code, spec_namespace)
39  File "C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec", line 7, in <module>
40    a = Analysis(['C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py'],
41  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 277, in __init__
42    self.__postinit__()
43  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\datastruct.py", line 155, in __postinit__
44    self.assemble()
45  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 439, in assemble
46    priority_scripts.append(self.graph.add_script(script))
47  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 265, in add_script
48    self._top_script_node = super().add_script(pathname)
49  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1433, in add_script
50    self._process_imports(n)
51  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
52    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
53  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
54    target_modules = self.import_hook(
55  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
56    target_package, target_module_partname = self._find_head_package(
57  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
58    target_package = self._safe_import_module(
59  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
60    return super()._safe_import_module(module_basename, module_name, parent_package)
61  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
62    self._process_imports(n)
63  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
64    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
65  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
66    target_modules = self.import_hook(
67  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
68    target_package, target_module_partname = self._find_head_package(
69  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
70    target_package = self._safe_import_module(
71  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
72    return super()._safe_import_module(module_basename, module_name, parent_package)
73  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
74    self._process_imports(n)
75  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
76    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
77  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
78    target_modules = self.import_hook(
79  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
80    target_package, target_module_partname = self._find_head_package(
81  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
82    target_package = self._safe_import_module(
83  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
84    return super()._safe_import_module(module_basename, module_name, parent_package)
85  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
86    self._process_imports(n)
87  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
88    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
89  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
90    target_modules = self.import_hook(
91  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
92    target_package, target_module_partname = self._find_head_package(
93  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
94    target_package = self._safe_import_module(
95  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
96    return super()._safe_import_module(module_basename, module_name, parent_package)
97  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
98    self._process_imports(n)
99  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
100    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
101  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
102    target_modules = self.import_hook(
103  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
104    submodule = self._safe_import_module(head, mname, submodule)
105  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
106    return super()._safe_import_module(module_basename, module_name, parent_package)
107  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
108    self._process_imports(n)
109  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
110    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
111  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
112    target_modules = self.import_hook(
113  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
114    submodule = self._safe_import_module(head, mname, submodule)
115  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
116    return super()._safe_import_module(module_basename, module_name, parent_package)
117  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
118    self._process_imports(n)
119  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
120    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
121  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
122    target_modules = self.import_hook(
123  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
124    submodule = self._safe_import_module(head, mname, submodule)
125  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
126    return super()._safe_import_module(module_basename, module_name, parent_package)
127  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2061, in _safe_import_module
128    n = self._scan_code(module, co, co_ast)
129  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2645, in _scan_code
130    self._scan_bytecode(
131  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2749, in _scan_bytecode
132    for inst in util.iterate_instructions(module_code_object):
133  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 147, in iterate_instructions
134    yield from iterate_instructions(constant)
135  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 139, in iterate_instructions
136    yield from get_instructions(code_object)
137  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 338, in _get_instructions_bytes
138    argval, argrepr = _get_const_info(arg, constants)
139  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 292, in _get_const_info
140    argval = const_list[const_index]
141IndexError: tuple index out of range
142
143Project output will not be moved to output folder
144Complete.
145

I understand that there is a thread already about similar issue but it still doesn't solve the issue. Hence seeking out help

I really have no idea why is the error occurring and how to resolve it. I am pasting the script below for your reference. Can some one please help? Thank you in advance

1Running auto-py-to-exe v2.10.1
2Building directory: C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
3Provided command: pyinstaller --noconfirm --onedir --console --no-embed-manifest  "C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py"
4Recursion Limit is set to 5000
5Executing: pyinstaller --noconfirm --onedir --console --no-embed-manifest C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py --distpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\application --workpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\build --specpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
6
742681 INFO: PyInstaller: 4.6
842690 INFO: Python: 3.10.0
942732 INFO: Platform: Windows-10-10.0.19042-SP0
1042744 INFO: wrote C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec
1142764 INFO: UPX is not available.
1242772 INFO: Extending PYTHONPATH with paths
13['C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310']
1443887 INFO: checking Analysis
1543891 INFO: Building Analysis because Analysis-00.toc is non existent
1643895 INFO: Initializing module dependency graph...
1743915 INFO: Caching module graph hooks...
1843975 INFO: Analyzing base_library.zip ...
1954298 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2054306 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib'
2157474 INFO: Caching module dependency graph...
2258088 INFO: running Analysis Analysis-00.toc
2358132 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
24  required by C:\Users\Tarun\AppData\Local\Programs\Python\Python310\python.exe
2558365 INFO: Analyzing C:\Users\Tarun\AppData\Local\Programs\Python\Python310\AI_Ass.py
2659641 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
27An error occurred while packaging
28Traceback (most recent call last):
29  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
30    run_pyinstaller()
31  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 124, in run
32    run_build(pyi_config, spec_file, **vars(args))
33  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
34    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
35  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
36    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
37  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
38    exec(code, spec_namespace)
39  File "C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec", line 7, in <module>
40    a = Analysis(['C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py'],
41  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 277, in __init__
42    self.__postinit__()
43  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\datastruct.py", line 155, in __postinit__
44    self.assemble()
45  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 439, in assemble
46    priority_scripts.append(self.graph.add_script(script))
47  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 265, in add_script
48    self._top_script_node = super().add_script(pathname)
49  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1433, in add_script
50    self._process_imports(n)
51  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
52    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
53  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
54    target_modules = self.import_hook(
55  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
56    target_package, target_module_partname = self._find_head_package(
57  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
58    target_package = self._safe_import_module(
59  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
60    return super()._safe_import_module(module_basename, module_name, parent_package)
61  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
62    self._process_imports(n)
63  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
64    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
65  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
66    target_modules = self.import_hook(
67  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
68    target_package, target_module_partname = self._find_head_package(
69  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
70    target_package = self._safe_import_module(
71  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
72    return super()._safe_import_module(module_basename, module_name, parent_package)
73  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
74    self._process_imports(n)
75  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
76    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
77  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
78    target_modules = self.import_hook(
79  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
80    target_package, target_module_partname = self._find_head_package(
81  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
82    target_package = self._safe_import_module(
83  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
84    return super()._safe_import_module(module_basename, module_name, parent_package)
85  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
86    self._process_imports(n)
87  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
88    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
89  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
90    target_modules = self.import_hook(
91  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
92    target_package, target_module_partname = self._find_head_package(
93  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
94    target_package = self._safe_import_module(
95  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
96    return super()._safe_import_module(module_basename, module_name, parent_package)
97  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
98    self._process_imports(n)
99  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
100    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
101  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
102    target_modules = self.import_hook(
103  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
104    submodule = self._safe_import_module(head, mname, submodule)
105  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
106    return super()._safe_import_module(module_basename, module_name, parent_package)
107  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
108    self._process_imports(n)
109  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
110    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
111  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
112    target_modules = self.import_hook(
113  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
114    submodule = self._safe_import_module(head, mname, submodule)
115  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
116    return super()._safe_import_module(module_basename, module_name, parent_package)
117  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
118    self._process_imports(n)
119  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
120    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
121  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
122    target_modules = self.import_hook(
123  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
124    submodule = self._safe_import_module(head, mname, submodule)
125  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
126    return super()._safe_import_module(module_basename, module_name, parent_package)
127  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2061, in _safe_import_module
128    n = self._scan_code(module, co, co_ast)
129  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2645, in _scan_code
130    self._scan_bytecode(
131  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2749, in _scan_bytecode
132    for inst in util.iterate_instructions(module_code_object):
133  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 147, in iterate_instructions
134    yield from iterate_instructions(constant)
135  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 139, in iterate_instructions
136    yield from get_instructions(code_object)
137  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 338, in _get_instructions_bytes
138    argval, argrepr = _get_const_info(arg, constants)
139  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 292, in _get_const_info
140    argval = const_list[const_index]
141IndexError: tuple index out of range
142
143Project output will not be moved to output folder
144Complete.
145#importing libraries
146
147import speech_recognition as sr
148import pyttsx3
149import datetime
150import wikipedia
151import webbrowser
152import os
153import time
154import subprocess
155from   ecapture import ecapture as ec
156import wolframalpha
157import json
158import requests
159
160#setting up speech engine
161engine=pyttsx3.init('sapi5')
162voices=engine.getProperty('voices')
163engine.setProperty('voice','voices[1].id')
164
165def speak(text):
166    engine.say(text)
167    engine.runAndWait()
168    
169#Greet user
170def wishMe():
171    hour=datetime.datetime.now().hour
172    if hour>=0 and hour<12:
173        speak("Hello,Good Morning")
174        print("Hello,Good Morning")
175    elif hour>=12 and hour<18:
176        speak("Hello,Good Afternoon")
177        print("Hello,Good Afternoon")
178    else:
179        speak("Hello,Good Evening")
180        print("Hello,Good Evening")
181
182#Setting up the command function for your AI assistant
183def takeCommand():
184    r=sr.Recognizer()
185    with sr.Microphone() as source:
186        print("Listening...")
187        audio=r.listen(source)
188
189        try:
190            statement=r.recognize_google(audio,language='en-in')
191            print(f"user said:{statement}\n")
192
193        except Exception as e:
194            speak("Pardon me, please say that again")
195            return "None"
196        return statement
197
198print("Loading your AI personal assistant Friday")
199speak("Loading your AI personal assistant Friday")
200wishMe()
201
202#main function
203if __name__=='__main__':
204
205
206    while True:
207        speak("Tell me how can I help you now?")
208        statement = takeCommand().lower()
209        if statement==0:
210            continue
211
212        if "good bye" in statement or "ok bye" in statement or "stop" in statement:
213            speak('your personal assistant Friday is shutting down,Good bye')
214            print('your personal assistant Friday is shutting down,Good bye')
215            break
216
217
218        if 'wikipedia' in statement:
219            speak('Searching Wikipedia...')
220            statement =statement.replace("wikipedia", "")
221            results = wikipedia.summary(statement, sentences=10)
222            webbrowser.open_new_tab("https://en.wikipedia.org/wiki/"+ statement)
223            speak("According to Wikipedia")
224            print(results)
225            speak(results)
226
227        elif 'open youtube' in statement:
228            webbrowser.register('chrome', None,
229        webbrowser.BackgroundBrowser("C://Program Files (x86)//Google//Chrome//Application//chrome.exe"))
230            webbrowser.get('chrome').open_new_tab("https://www.youtube.com")
231            #webbrowser.open_new_tab("https://www.youtube.com")
232            speak("youtube is open now")
233            time.sleep(5)
234
235        elif 'open google' in statement:
236            webbrowser.open_new_tab("https://www.google.com")
237            speak("Google chrome is open now")
238            time.sleep(5)
239
240        elif 'open gmail' in statement:
241            webbrowser.open_new_tab("gmail.com")
242            speak("Google Mail open now")
243            time.sleep(5)
244        
245        elif 'time' in statement:
246            strTime=datetime.datetime.now().strftime("%H:%M:%S")
247            speak(f"the time is {strTime}")
248
249        elif 'news' in statement:
250            news = webbrowser.open_new_tab("https://timesofindia.indiatimes.com/home/headlines")
251            speak('Here are some headlines from the Times of India,Happy reading')
252            time.sleep(6)
253
254        elif "camera" in statement or "take a photo" in statement:
255            ec.capture(0,"robo camera","img.jpg")
256
257        elif 'search' in statement:
258            statement = statement.replace("search", "")
259            webbrowser.open_new_tab(statement)
260            time.sleep(5)
261
262        elif 'who are you' in statement or 'what can you do' in statement:
263            speak('I am Friday version 1 point O your personal assistant. I am programmed to minor tasks like'
264            'opening youtube,google chrome, gmail and stackoverflow ,predict time,take a photo,search wikipedia,predict weather' 
265            'In different cities, get top headline news from times of india and you can ask me computational or geographical questions too!')
266
267
268        elif "who made you" in statement or "who created you" in statement or "who discovered you" in statement:
269            speak("I was built by Mirthula")
270            print("I was built by Mirthula")
271
272        elif "log off" in statement or "sign out" in statement:
273            speak("Ok , your pc will log off in 10 sec make sure you exit from all applications")
274            subprocess.call(["shutdown", "/l"])
275            
276time.sleep(3)
277

ANSWER

Answered 2021-Nov-05 at 02:20

copy icondownload icon

1Running auto-py-to-exe v2.10.1
2Building directory: C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
3Provided command: pyinstaller --noconfirm --onedir --console --no-embed-manifest  "C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py"
4Recursion Limit is set to 5000
5Executing: pyinstaller --noconfirm --onedir --console --no-embed-manifest C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py --distpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\application --workpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\build --specpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
6
742681 INFO: PyInstaller: 4.6
842690 INFO: Python: 3.10.0
942732 INFO: Platform: Windows-10-10.0.19042-SP0
1042744 INFO: wrote C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec
1142764 INFO: UPX is not available.
1242772 INFO: Extending PYTHONPATH with paths
13['C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310']
1443887 INFO: checking Analysis
1543891 INFO: Building Analysis because Analysis-00.toc is non existent
1643895 INFO: Initializing module dependency graph...
1743915 INFO: Caching module graph hooks...
1843975 INFO: Analyzing base_library.zip ...
1954298 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2054306 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib'
2157474 INFO: Caching module dependency graph...
2258088 INFO: running Analysis Analysis-00.toc
2358132 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
24  required by C:\Users\Tarun\AppData\Local\Programs\Python\Python310\python.exe
2558365 INFO: Analyzing C:\Users\Tarun\AppData\Local\Programs\Python\Python310\AI_Ass.py
2659641 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
27An error occurred while packaging
28Traceback (most recent call last):
29  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
30    run_pyinstaller()
31  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 124, in run
32    run_build(pyi_config, spec_file, **vars(args))
33  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
34    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
35  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
36    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
37  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
38    exec(code, spec_namespace)
39  File "C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec", line 7, in <module>
40    a = Analysis(['C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py'],
41  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 277, in __init__
42    self.__postinit__()
43  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\datastruct.py", line 155, in __postinit__
44    self.assemble()
45  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 439, in assemble
46    priority_scripts.append(self.graph.add_script(script))
47  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 265, in add_script
48    self._top_script_node = super().add_script(pathname)
49  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1433, in add_script
50    self._process_imports(n)
51  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
52    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
53  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
54    target_modules = self.import_hook(
55  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
56    target_package, target_module_partname = self._find_head_package(
57  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
58    target_package = self._safe_import_module(
59  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
60    return super()._safe_import_module(module_basename, module_name, parent_package)
61  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
62    self._process_imports(n)
63  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
64    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
65  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
66    target_modules = self.import_hook(
67  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
68    target_package, target_module_partname = self._find_head_package(
69  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
70    target_package = self._safe_import_module(
71  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
72    return super()._safe_import_module(module_basename, module_name, parent_package)
73  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
74    self._process_imports(n)
75  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
76    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
77  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
78    target_modules = self.import_hook(
79  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
80    target_package, target_module_partname = self._find_head_package(
81  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
82    target_package = self._safe_import_module(
83  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
84    return super()._safe_import_module(module_basename, module_name, parent_package)
85  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
86    self._process_imports(n)
87  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
88    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
89  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
90    target_modules = self.import_hook(
91  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
92    target_package, target_module_partname = self._find_head_package(
93  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
94    target_package = self._safe_import_module(
95  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
96    return super()._safe_import_module(module_basename, module_name, parent_package)
97  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
98    self._process_imports(n)
99  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
100    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
101  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
102    target_modules = self.import_hook(
103  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
104    submodule = self._safe_import_module(head, mname, submodule)
105  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
106    return super()._safe_import_module(module_basename, module_name, parent_package)
107  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
108    self._process_imports(n)
109  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
110    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
111  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
112    target_modules = self.import_hook(
113  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
114    submodule = self._safe_import_module(head, mname, submodule)
115  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
116    return super()._safe_import_module(module_basename, module_name, parent_package)
117  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
118    self._process_imports(n)
119  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
120    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
121  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
122    target_modules = self.import_hook(
123  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
124    submodule = self._safe_import_module(head, mname, submodule)
125  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
126    return super()._safe_import_module(module_basename, module_name, parent_package)
127  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2061, in _safe_import_module
128    n = self._scan_code(module, co, co_ast)
129  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2645, in _scan_code
130    self._scan_bytecode(
131  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2749, in _scan_bytecode
132    for inst in util.iterate_instructions(module_code_object):
133  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 147, in iterate_instructions
134    yield from iterate_instructions(constant)
135  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 139, in iterate_instructions
136    yield from get_instructions(code_object)
137  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 338, in _get_instructions_bytes
138    argval, argrepr = _get_const_info(arg, constants)
139  File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 292, in _get_const_info
140    argval = const_list[const_index]
141IndexError: tuple index out of range
142
143Project output will not be moved to output folder
144Complete.
145#importing libraries
146
147import speech_recognition as sr
148import pyttsx3
149import datetime
150import wikipedia
151import webbrowser
152import os
153import time
154import subprocess
155from   ecapture import ecapture as ec
156import wolframalpha
157import json
158import requests
159
160#setting up speech engine
161engine=pyttsx3.init('sapi5')
162voices=engine.getProperty('voices')
163engine.setProperty('voice','voices[1].id')
164
165def speak(text):
166    engine.say(text)
167    engine.runAndWait()
168    
169#Greet user
170def wishMe():
171    hour=datetime.datetime.now().hour
172    if hour>=0 and hour<12:
173        speak("Hello,Good Morning")
174        print("Hello,Good Morning")
175    elif hour>=12 and hour<18:
176        speak("Hello,Good Afternoon")
177        print("Hello,Good Afternoon")
178    else:
179        speak("Hello,Good Evening")
180        print("Hello,Good Evening")
181
182#Setting up the command function for your AI assistant
183def takeCommand():
184    r=sr.Recognizer()
185    with sr.Microphone() as source:
186        print("Listening...")
187        audio=r.listen(source)
188
189        try:
190            statement=r.recognize_google(audio,language='en-in')
191            print(f"user said:{statement}\n")
192
193        except Exception as e:
194            speak("Pardon me, please say that again")
195            return "None"
196        return statement
197
198print("Loading your AI personal assistant Friday")
199speak("Loading your AI personal assistant Friday")
200wishMe()
201
202#main function
203if __name__=='__main__':
204
205
206    while True:
207        speak("Tell me how can I help you now?")
208        statement = takeCommand().lower()
209        if statement==0:
210            continue
211
212        if "good bye" in statement or "ok bye" in statement or "stop" in statement:
213            speak('your personal assistant Friday is shutting down,Good bye')
214            print('your personal assistant Friday is shutting down,Good bye')
215            break
216
217
218        if 'wikipedia' in statement:
219            speak('Searching Wikipedia...')
220            statement =statement.replace("wikipedia", "")
221            results = wikipedia.summary(statement, sentences=10)
222            webbrowser.open_new_tab("https://en.wikipedia.org/wiki/"+ statement)
223            speak("According to Wikipedia")
224            print(results)
225            speak(results)
226
227        elif 'open youtube' in statement:
228            webbrowser.register('chrome', None,
229        webbrowser.BackgroundBrowser("C://Program Files (x86)//Google//Chrome//Application//chrome.exe"))
230            webbrowser.get('chrome').open_new_tab("https://www.youtube.com")
231            #webbrowser.open_new_tab("https://www.youtube.com")
232            speak("youtube is open now")
233            time.sleep(5)
234
235        elif 'open google' in statement:
236            webbrowser.open_new_tab("https://www.google.com")
237            speak("Google chrome is open now")
238            time.sleep(5)
239
240        elif 'open gmail' in statement:
241            webbrowser.open_new_tab("gmail.com")
242            speak("Google Mail open now")
243            time.sleep(5)
244        
245        elif 'time' in statement:
246            strTime=datetime.datetime.now().strftime("%H:%M:%S")
247            speak(f"the time is {strTime}")
248
249        elif 'news' in statement:
250            news = webbrowser.open_new_tab("https://timesofindia.indiatimes.com/home/headlines")
251            speak('Here are some headlines from the Times of India,Happy reading')
252            time.sleep(6)
253
254        elif "camera" in statement or "take a photo" in statement:
255            ec.capture(0,"robo camera","img.jpg")
256
257        elif 'search' in statement:
258            statement = statement.replace("search", "")
259            webbrowser.open_new_tab(statement)
260            time.sleep(5)
261
262        elif 'who are you' in statement or 'what can you do' in statement:
263            speak('I am Friday version 1 point O your personal assistant. I am programmed to minor tasks like'
264            'opening youtube,google chrome, gmail and stackoverflow ,predict time,take a photo,search wikipedia,predict weather' 
265            'In different cities, get top headline news from times of india and you can ask me computational or geographical questions too!')
266
267
268        elif "who made you" in statement or "who created you" in statement or "who discovered you" in statement:
269            speak("I was built by Mirthula")
270            print("I was built by Mirthula")
271
272        elif "log off" in statement or "sign out" in statement:
273            speak("Ok , your pc will log off in 10 sec make sure you exit from all applications")
274            subprocess.call(["shutdown", "/l"])
275            
276time.sleep(3)
27742681 INFO: PyInstaller: 4.6
27842690 INFO: Python: 3.10.0
279

There's the issue. Python 3.10.0 has a bug with PyInstaller 4.6. The problem isn't you or PyInstaller. Try converting it using Python 3.9.7 instead. Ironic, considering 3.10.0 was suppose to be a bugfix update.

Source https://stackoverflow.com/questions/69776492