Re: [PyInstaller] Re: Module Distribution not found but is required by the application

2020-07-06 Thread alon shoa
Hi,
so an update, my issue was related to keras2onnx,
I found (a hack) that if you remove the version check in
%env_location%\Lib\site-packages\keras2onnx\proto\__init__.py
remove the call to
#_check_onnx_version()
This seems to fix the issue for me.


Alon

On Mon, 6 Jul 2020 at 10:39, alon shoa  wrote:

> Hi,
> I have the same problem,
> I'm using onnx 1.7.
> it creates the exe file, but it fails on runtime with the same exception.
> I'm using keras2onnx to create a onnx model.
> tried adding it as hidden-import or adding it as additional hook folder,
> but I'm new to pyinstaller, so maybe the hook part is an incorrect way
>
> were you able to solve your problem?
>
> when you say  It’s running quite happily on my machine. what onnx did you
> use? how did you try to run it?
>
> thanks,
> Alon
>
> On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>>
>> Hi,
>>
>> Is there more of a traceback you can provide besides the 
>> pkg_resources.DistributionNotFound:
>> The "onnx" distribution was not found and is required by the application
>> line? I’ve seen errors like that caused when packages use pkg_resources
>> to get there own version to set as a __version__ attribute but I can’t
>> see anything like that in ONNX’s or keras’s source code. It’s running quite
>> happily on my machine.
>>
>> Brénainn
>> ​
>> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 ap...@ualberta.ca wrote:
>>
>>> Hi there,
>>>
>>> I am currently trying to train a Deep learning module and amd importing
>>> and exporting using ONNX and keras converters. These libraries are seldom
>>> used with Pyinstaller and result in the following error when i run the .exe
>>> file:
>>>
>>> pkg_resources.DistributionNotFound: The "onnx" distribution was not
>>> found and is required by the application
>>>
>>> I have already tried including the onnx dependency within the .spec file
>>> upon building the executable here, but I figured that I am probably doing
>>> something incorrectly in the analysis section:
>>> .
>>> datas=[('GrayscaleClassifierFast_3.onnx', '.'),
>>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"),
>>> "tensorflow/lite/experimental/microfrontend/python/ops/")],
>>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  .
>>>
>>> Has anyone else experienced the pkg.resource error? How was this dealt
>>> with? Thanks!
>>>
>>> Allen
>>>
>>
> On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>>
>> Hi,
>>
>> Is there more of a traceback you can provide besides the 
>> pkg_resources.DistributionNotFound:
>> The "onnx" distribution was not found and is required by the application
>> line? I’ve seen errors like that caused when packages use pkg_resources
>> to get there own version to set as a __version__ attribute but I can’t
>> see anything like that in ONNX’s or keras’s source code. It’s running quite
>> happily on my machine.
>>
>> Brénainn
>> ​
>> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 ap...@ualberta.ca wrote:
>>
>>> Hi there,
>>>
>>> I am currently trying to train a Deep learning module and amd importing
>>> and exporting using ONNX and keras converters. These libraries are seldom
>>> used with Pyinstaller and result in the following error when i run the .exe
>>> file:
>>>
>>> pkg_resources.DistributionNotFound: The "onnx" distribution was not
>>> found and is required by the application
>>>
>>> I have already tried including the onnx dependency within the .spec file
>>> upon building the executable here, but I figured that I am probably doing
>>> something incorrectly in the analysis section:
>>> .
>>> datas=[('GrayscaleClassifierFast_3.onnx', '.'),
>>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"),
>>> "tensorflow/lite/experimental/microfrontend/python/ops/")],
>>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  .
>>>
>>> Has anyone else experienced the pkg.resource error? How was this dealt
>>> with? Thanks!
>>>
>>> Allen
>>>
>>
> On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
&

[PyInstaller] Re: Module Distribution not found but is required by the application

2020-07-06 Thread alon shoa
Hi,
I have the same problem,
I'm using onnx 1.7.
it creates the exe file, but it fails on runtime with the same exception.
I'm using keras2onnx to create a onnx model.
tried adding it as hidden-import or adding it as additional hook folder, 
but I'm new to pyinstaller, so maybe the hook part is an incorrect way

were you able to solve your problem?

when you say  It’s running quite happily on my machine. what onnx did you 
use? how did you try to run it?

thanks,
Alon

On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>
> Hi,
>
> Is there more of a traceback you can provide besides the 
> pkg_resources.DistributionNotFound: 
> The "onnx" distribution was not found and is required by the application 
> line? I’ve seen errors like that caused when packages use pkg_resources 
> to get there own version to set as a __version__ attribute but I can’t 
> see anything like that in ONNX’s or keras’s source code. It’s running quite 
> happily on my machine.
>
> Brénainn
> ​
> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 ap...@ualberta.ca wrote:
>
>> Hi there,
>>
>> I am currently trying to train a Deep learning module and amd importing 
>> and exporting using ONNX and keras converters. These libraries are seldom 
>> used with Pyinstaller and result in the following error when i run the .exe 
>> file:
>>
>> pkg_resources.DistributionNotFound: The "onnx" distribution was not found 
>> and is required by the application
>>
>> I have already tried including the onnx dependency within the .spec file 
>> upon building the executable here, but I figured that I am probably doing 
>> something incorrectly in the analysis section:
>> .
>> datas=[('GrayscaleClassifierFast_3.onnx', '.'), 
>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>  
>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"), 
>> "tensorflow/lite/experimental/microfrontend/python/ops/")], 
>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  . 
>>
>> Has anyone else experienced the pkg.resource error? How was this dealt 
>> with? Thanks!
>>
>> Allen
>>
>
On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>
> Hi,
>
> Is there more of a traceback you can provide besides the 
> pkg_resources.DistributionNotFound: 
> The "onnx" distribution was not found and is required by the application 
> line? I’ve seen errors like that caused when packages use pkg_resources 
> to get there own version to set as a __version__ attribute but I can’t 
> see anything like that in ONNX’s or keras’s source code. It’s running quite 
> happily on my machine.
>
> Brénainn
> ​
> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 ap...@ualberta.ca wrote:
>
>> Hi there,
>>
>> I am currently trying to train a Deep learning module and amd importing 
>> and exporting using ONNX and keras converters. These libraries are seldom 
>> used with Pyinstaller and result in the following error when i run the .exe 
>> file:
>>
>> pkg_resources.DistributionNotFound: The "onnx" distribution was not found 
>> and is required by the application
>>
>> I have already tried including the onnx dependency within the .spec file 
>> upon building the executable here, but I figured that I am probably doing 
>> something incorrectly in the analysis section:
>> .
>> datas=[('GrayscaleClassifierFast_3.onnx', '.'), 
>> (os.path.join(os.path.dirname(importlib.import_module('tensorflow').__file__),
>>  
>> "lite/experimental/microfrontend/python/ops/_audio_microfrontend_op.so"), 
>> "tensorflow/lite/experimental/microfrontend/python/ops/")], 
>> hiddenimports=['pkg_resources.py2_warn', 'tensorflow'],  . 
>>
>> Has anyone else experienced the pkg.resource error? How was this dealt 
>> with? Thanks!
>>
>> Allen
>>
>
On Saturday, July 4, 2020 at 8:48:31 PM UTC+3, bwoodsend wrote:
>
> Hi,
>
> Is there more of a traceback you can provide besides the 
> pkg_resources.DistributionNotFound: 
> The "onnx" distribution was not found and is required by the application 
> line? I’ve seen errors like that caused when packages use pkg_resources 
> to get there own version to set as a __version__ attribute but I can’t 
> see anything like that in ONNX’s or keras’s source code. It’s running quite 
> happily on my machine.
>
> Brénainn
> ​
> On Friday, July 3, 2020 at 6:46:43 PM UTC+1 ap...@ualberta.ca wrote:
>
>> Hi there,
>>
>> I am currently trying to train a Deep learning module and amd importing 
>> and exporting using ONNX and keras converters. These libraries are seldom 
>> used with Pyinstaller and result in the following error when i run the .exe 
>> file:
>>
>> pkg_resources.DistributionNotFound: The "onnx" distribution was not found 
>> and is required by the application
>>
>> I have already tried including the onnx dependency within the .spec file 
>> upon building the executable here, but I figured that I am probably doing 
>> something incorrectly in the analysis section:
>> .
>>