Thanks.
" it only packages the modules it thinks your program needs"

The question is - why doesn't it think any program doesn't need certain 
modules?

1. There is an import statement for that module at the top of the file.
2. There is clear usage of that module in the program, as in:
     result = module.function_call() 

I've tried several of these 
"https://www.pyinstaller.org/en/stable/when-things-go-wrong.html#helping-pyinstaller-find-modules";
 
fixes.
I've gotten past a few of them by doing "Add file". This is the step that 
seems wrong though, since the module is imported and a function is called 
in that module.


On Thursday, January 4, 2024 at 6:08:42 PM UTC-8 Jasper Harrison wrote:

> To answer the more general question of why PyInstaller can't find a 
> certain module at runtime - it only packages the modules it thinks your 
> program needs, and sometimes it doesn't detect a module correctly, leading 
> to it not being included.
>
> Jasper Harrison, aka Legorooj
> Core Developer on PyInstaller
> https://legorooj.net
>
>
>
>
>
>
> -------- Original Message --------
> On 5 Jan 2024, 01:30, Tony C < [email protected]> wrote:
>
>
>
> Hello,
>
> I've been reading through the Pyinstaller docs trying to understand why 
> the Python interpreter can find modules at application runtime (as sources, 
> NOT an exe), but Pyinstaller
> cannot. Pyinstaller itself is also a python application.
>
> Oddly enough, I ran into an issue today where Pyinstaller couldn't find an 
> import that comes with the Python interpreter (Python 3.11). This makes no 
> sense to me.
>
> When I fire up the python interpreter and manually import that module 
> (imp.py)
> the import works, although a deprecation warning is displayed.
>
> *import imp*
> "<stdin>:1: DeprecationWarning: the imp module is deprecated in favour of 
> importlib and slated for removal in Python 3.12; see the module's 
> documentation for alternative uses" 
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pyinstaller/5aebaf08-6c8b-4f4d-b542-52846d89cd9en%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/pyinstaller/5aebaf08-6c8b-4f4d-b542-52846d89cd9en%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/64310971-8f19-4fdf-bcbf-58887b97a4fcn%40googlegroups.com.

Reply via email to