pyinstaller

Christian Gollwitzer auriocus at gmx.de
Wed Jul 27 02:23:49 EDT 2016


Am 27.07.16 um 03:15 schrieb Larry Martell:
> On Tue, Jul 26, 2016 at 8:49 PM, Tom Brown <nextstate at gmail.com> wrote:
>> I used pyinstaller quite a bit 3 years ago. I could brush off the cobwebs
>> and see if I can help if you have not solved it already.
>>
>> What is the issue you are having?
>
> If I import the requests module, then when I run the executable I get:
>
> ImportError: No module named 'requests.packages.chardet'

That's a classic issue. pyinstaller does static analysis of the program, 
which modules must be included. If the code computes a module 
dynamically, it can not always succeed. The solution is to tell 
pyinstaller to add this module. In previous versions, you could add 
these by "pyinstaller --hidden-import=requests.packages.chardet" or 
similar. If this doesn't work, you need to edit the spec file. See here:

https://pythonhosted.org/PyInstaller/when-things-go-wrong.html#listing-hidden-imports

	Chrstian



More information about the Python-list mailing list