Re: [PyInstaller] Re: numpy using mkl libraries

2020-07-06 Thread 'Chris Barker' via PyInstaller
> *Question*: why the mkl libraries are not properly detected/used during
>>> runtime even if they are included in the executable?
>>>
>>
MKL does some run-time magic to detect the processor and the like, so it
may be linking in an unusual way that PyInstaller can not detect.

Adding it by hand may be the only solution. But it would be good it have a
recipe for this.

-CHB

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxE%2BCEF0nVPFDdn937U%3Dyo2Rfxd2S2FOjQNE055Nm6DEcRg%40mail.gmail.com.


[PyInstaller] Re: numpy using mkl libraries

2020-07-06 Thread Ricardo A Corredor J
*UPDATE 2 :* In the meantime ... I added the dll to the data variable in 
specs (as stated here 
https://stackoverflow.com/questions/62625517/pyinstaller-exe-file-terminates-early-without-an-error-message
 and 
here 
https://stackoverflow.com/questions/58096010/pyinstaller-importerror-with-scipy-dll-load-failed.
 
Is this Ok ? Seems to work ...

data = [('C:/envs/venv/Lib/Library/bin/libiomp5md.dll', '.')]

RaC


On Monday, July 6, 2020 at 5:41:26 PM UTC+2, Ricardo A Corredor J wrote:
>
> *UPDATE:*
>
> I checked one by one the dlls I had in the folder where the executable was 
> running and found that there was only one that was required to run the 
> executable properly:
>
>
>
> Seems like this omp library is not included in the executable. Any reason 
> why ? 
>
> Thanks in advance!
>
> RaC
>
>
> On Monday, July 6, 2020 at 4:41:46 PM UTC+2, Ricardo A Corredor J wrote:
>>
>> Hi everyone,
>>
>> I have a python code that internally uses *numpy *(plus other 
>> dependencies) to perform some basic numerical operations.
>>
>> I installed *numpy* as "*conda install numpy*" (Windows 10) meaning that 
>> it includes and uses the *mkl libraries*. After running pyinstaller on 
>> this code, I have an executable that contains the *mkl libraries. *I can 
>> see those dlls when I run the executable and check the folder created in 
>> Temp with all the dependencies uncompressed. Nevertheless, when I run the 
>> executable, t*he program crashes* when it tries to use numpy with the 
>> optimized mkl libraries (a *numpy.dot*(..,..) operation). I copied the 
>> executable to the folder where I have the dlls of the mkl libraries in my 
>> system and the program runs properly. 
>>
>> *Question*: why the mkl libraries are not properly detected/used during 
>> runtime even if they are included in the executable?  Is there a way to set 
>> the .specs to link properly to those dlls instead of copying always the 
>> dlls next to the program or adding to the path? If not, is there a way to 
>> properly exclude the mkl libs from the executable if in any case I need to 
>> use them from a different folder ?
>>
>> Thanks,
>>
>> Ricardo
>> RaC
>>
>

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/17420365-99c4-4328-a3dd-74b84edad02eo%40googlegroups.com.


[PyInstaller] Re: numpy using mkl libraries

2020-07-06 Thread 'S CartonForever' via PyInstaller
I can't answer the question I'm afraid. But did want to say thank you for 
asking it. I had the exact same error but didn't realise it. When I tried 
copying the required dll into the folder my compiled program is now 
working. So thanks, but yeah this seems to be two of us with this bug.


On Monday, July 6, 2020 at 4:41:26 PM UTC+1, Ricardo A Corredor J wrote:
>
> *UPDATE:*
>
> I checked one by one the dlls I had in the folder where the executable was 
> running and found that there was only one that was required to run the 
> executable properly:
>
>
>
> Seems like this omp library is not included in the executable. Any reason 
> why ? 
>
> Thanks in advance!
>
> RaC
>
>
> On Monday, July 6, 2020 at 4:41:46 PM UTC+2, Ricardo A Corredor J wrote:
>>
>> Hi everyone,
>>
>> I have a python code that internally uses *numpy *(plus other 
>> dependencies) to perform some basic numerical operations.
>>
>> I installed *numpy* as "*conda install numpy*" (Windows 10) meaning that 
>> it includes and uses the *mkl libraries*. After running pyinstaller on 
>> this code, I have an executable that contains the *mkl libraries. *I can 
>> see those dlls when I run the executable and check the folder created in 
>> Temp with all the dependencies uncompressed. Nevertheless, when I run the 
>> executable, t*he program crashes* when it tries to use numpy with the 
>> optimized mkl libraries (a *numpy.dot*(..,..) operation). I copied the 
>> executable to the folder where I have the dlls of the mkl libraries in my 
>> system and the program runs properly. 
>>
>> *Question*: why the mkl libraries are not properly detected/used during 
>> runtime even if they are included in the executable?  Is there a way to set 
>> the .specs to link properly to those dlls instead of copying always the 
>> dlls next to the program or adding to the path? If not, is there a way to 
>> properly exclude the mkl libs from the executable if in any case I need to 
>> use them from a different folder ?
>>
>> Thanks,
>>
>> Ricardo
>> RaC
>>
>

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/7552633b-28d0-4dd0-af85-dfcfb6bac2b9o%40googlegroups.com.


[PyInstaller] Re: numpy using mkl libraries

2020-07-06 Thread Ricardo A Corredor J
*UPDATE:*

I checked one by one the dlls I had in the folder where the executable was 
running and found that there was only one that was required to run the 
executable properly:



Seems like this omp library is not included in the executable. Any reason 
why ? 

Thanks in advance!

RaC


On Monday, July 6, 2020 at 4:41:46 PM UTC+2, Ricardo A Corredor J wrote:
>
> Hi everyone,
>
> I have a python code that internally uses *numpy *(plus other 
> dependencies) to perform some basic numerical operations.
>
> I installed *numpy* as "*conda install numpy*" (Windows 10) meaning that 
> it includes and uses the *mkl libraries*. After running pyinstaller on 
> this code, I have an executable that contains the *mkl libraries. *I can 
> see those dlls when I run the executable and check the folder created in 
> Temp with all the dependencies uncompressed. Nevertheless, when I run the 
> executable, t*he program crashes* when it tries to use numpy with the 
> optimized mkl libraries (a *numpy.dot*(..,..) operation). I copied the 
> executable to the folder where I have the dlls of the mkl libraries in my 
> system and the program runs properly. 
>
> *Question*: why the mkl libraries are not properly detected/used during 
> runtime even if they are included in the executable?  Is there a way to set 
> the .specs to link properly to those dlls instead of copying always the 
> dlls next to the program or adding to the path? If not, is there a way to 
> properly exclude the mkl libs from the executable if in any case I need to 
> use them from a different folder ?
>
> Thanks,
>
> Ricardo
> RaC
>

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/3766df91-a169-4c70-93c3-22a7706519f7o%40googlegroups.com.


[PyInstaller] numpy using mkl libraries

2020-07-06 Thread Ricardo A Corredor J
Hi everyone,

I have a python code that internally uses *numpy *(plus other dependencies) 
to perform some basic numerical operations.

I installed *numpy* as "*conda install numpy*" (Windows 10) meaning that it 
includes and uses the *mkl libraries*. After running pyinstaller on this 
code, I have an executable that contains the *mkl libraries. *I can see 
those dlls when I run the executable and check the folder created in Temp 
with all the dependencies uncompressed. Nevertheless, when I run the 
executable, t*he program crashes* when it tries to use numpy with the 
optimized mkl libraries (a *numpy.dot*(..,..) operation). I copied the 
executable to the folder where I have the dlls of the mkl libraries in my 
system and the program runs properly. 

*Question*: why the mkl libraries are not properly detected/used during 
runtime even if they are included in the executable?  Is there a way to set 
the .specs to link properly to those dlls instead of copying always the 
dlls next to the program or adding to the path? If not, is there a way to 
properly exclude the mkl libs from the executable if in any case I need to 
use them from a different folder ?

Thanks,

Ricardo
RaC

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/20a0f688-4032-409c-b48f-3e777a32cb57o%40googlegroups.com.


[PyInstaller] Re: any easy way to re-use what pyinstaller has created?

2020-07-06 Thread 进陆


在 2020年7月6日星期一 UTC+8下午8:18:37,bwoodsend写道:
>
> Hello,
>
> Firstly you certainly shouldn’t need to copy those files about. It looks 
> like the problem is nimpy can’t read the standard lib files from the 
> base_library.zip archive and you’re extracting them manually. 
>
if I copy pyc files(i.e. contextlib.pyc, genericpath.pyc, ntpath.pyc, 
os.pyc, site.pyc, stat.pyc, sysconfig.pyc, token.pyc, tokenize.pyc, 
_sitebuiltins.pyc) into `base_library.zip`, `main_nim.exe` can run which 
means `nimpy` can read modules from `base_library.zip`
 

> You can tell PyInstaller not to use the zip by adding the kwarg 
> noarchive=True to the a = Analysis(...) section of the main.spec file. 
> (If you’re new to spec files - it’s just a Python script containing all the 
> build code.) If you edit the spec you must use PyInstaller main.spec 
> instead of PyInstaller main.py or you will lose your changes.
>
I found I can use `pyinstaller  -d noarchive main.py` to tell pyinstaller 
not to create `base_library.zip`. Then pyinstaller can produce run-able 
`main.exe` from `main.py`

but I still need to copy 3 files(site.py,  _sitebuiltins.py and 
sysconfig.py) to ensure `main_nim.exe`(just as the name suggested, which is 
created by nim code) can run  

so that is not so-automatic yet.

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/28cb1ca1-1f6c-4b7f-9fe0-ba6a90515370o%40googlegroups.com.


[PyInstaller] Re: pyinstaller onefile and Windows XP: access denied on temp folder _MEI

2020-07-06 Thread bwoodsend


*The short answer: *
Use PyInstaller --onefile --runtime-tempdir . myscript.py to have the _MEI 
folder placed .

*The long answer:*
You can override where the _MEI folder goes with the --runtime-tmpdir. 
Quoting the docs:

—runtime-tmpdir PATH
Where to extract libraries and support files in onefile-mode. If this 
option is given, the bootloader will ignore any temp-folder location 
defined by the run-time OS. The _MEIxx- will be created here. Please 
use this option only if you know what you are doing.

The issue with this is that you have to know at build time the path to a 
safe run-time location. And as *safe* usually would imply a user directory 
and a user directory would likely contain their username and therefore 
depend on the machine running it this is effectively impossible. Normally 
you get around this by reading environment variables such as %HOME% but we 
don’t have that kind of control over the bootloader. The fix for this is to 
use a path relative to the application (which we’ll assume is in a folder 
the user has permission for).

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/f88fe6cb-5f0b-4c89-9bc9-74a1d976bfe0n%40googlegroups.com.


[PyInstaller] Re: any easy way to re-use what pyinstaller has created?

2020-07-06 Thread 进陆


在 2020年7月6日星期一 UTC+8下午8:18:37,bwoodsend写道:
>
> Hello,
>
> Firstly you certainly shouldn’t need to copy those files about. It looks 
> like the problem is nimpy can’t read the standard lib files from the 
> base_library.zip archive and you’re extracting them manually. You can 
> tell PyInstaller not to use the zip by adding the kwarg noarchive=True to 
> the a = Analysis(...) section of the main.spec file. (If you’re new to 
> spec files - it’s just a Python script containing all the build code.) If 
> you edit the spec you must use PyInstaller main.spec instead of PyInstaller 
> main.py or you will lose your changes.
>
I found I can use `pyinstaller  -d noarchive main.py` to tell pyinstaller 
not to create `base_library.zip`. Then pyinstaller can produce ruan-able 
`main.exe` from `main.py`

but I still need to copy 3 files(site.py,  _sitebuiltins.py and 
sysconfig.py) to ensure `main_nim.exe`(just as the name suggested, which is 
created by nim code) can run   
 

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/bba1667c-5c22-4329-a487-dcd5b003efa2o%40googlegroups.com.


[PyInstaller] Re: any easy way to re-use what pyinstaller has created?

2020-07-06 Thread bwoodsend


Hello,

Firstly you certainly shouldn’t need to copy those files about. It looks 
like the problem is nimpy can’t read the standard lib files from the 
base_library.zip archive and you’re extracting them manually. You can tell 
PyInstaller not to use the zip by adding the kwarg noarchive=True to the a 
= Analysis(...) section of the main.spec file. (If you’re new to spec files 
- it’s just a Python script containing all the build code.) If you edit the 
spec you must use PyInstaller main.spec instead of PyInstaller main.py or 
you will lose your changes.

Assuming the above doesn’t fix your problem: You can’t reuse bits of a 
build in the way you’re suggesting but you can still automate them. Again, 
use the spec file. You could append code to the end of your spec (such as 
code to copy those files in) and it will run that code after every build.

Also, I recommend Markdown Here  for using 
markdown in Google Groups.

Brénainn

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/9157bc9d-aebf-4d62-8959-506eff6918b8n%40googlegroups.com.


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:
>>
>> 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 

Re: [PyInstaller] skimage test

2020-07-06 Thread itsikw
Some time has passed, and the problem is now solved. I found out how to edit 
the spec file, and increased the iteration limit. I apologize for distracting 
this community with a rookie problems.

From: Yitzhak Weissman 
Sent: Monday, June 29, 2020 2:11 PM
To: PyInstaller 
Subject: [PyInstaller] skimage test

  Brénainn,
Thank you again for your continuing support. I attach the PyInstaller log for 
my script: 'from skimage.transform import warp'.
Actually, I have already researched this problem and found others who 
encountered it too. A few workarounds were suggested, but all look complicated 
and none guaranteed to work. Anyway, I do not have the tools to edit spec files.
As I said, the Anaconda pyinstaller worked well with this script.

  ​
-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/0c368a8e-eaf6-426b-b996-caed1f6bbd28o%40googlegroups.com.

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/7FEEE74A31574CA4B05E6D798A2CE173%40DAZ.


Re: [PyInstaller] Re: Raise AtributeError - using PySide2

2020-07-06 Thread Nurul Carvalho
I really appreciate your help .. but I'm really using PySide2 because my
PyQt5 scripts are returning ImportDLLerror ..

bwoodsend  escreveu no dia sábado, 4/07/2020 à(s)
19:48:

> Am I right in saying you are using PyQt5 and not PySide2? And PyInstaller
> appears to be trying to include both but failing on the PySide2 hook. In
> which case you just need to exclude PySide2 by passing --exclude PySide2.
> ​
> On Friday, July 3, 2020 at 6:43:40 PM UTC+1 nurulde...@gmail.com wrote:
>
>> Hello PyInstaller Comunity..
>> I need help with bug.. i can't build my PyQt scripts to exe..
>>
>> 156 INFO: PyInstaller: 3.6
>> 156 INFO: Python: 3.8.3
>> 157 INFO: Platform: Windows-10-10.0.14393-SP0
>> 169 INFO: UPX is not available.
>> 211 INFO: Extending PYTHONPATH with paths
>> ['C:\\Users\\Nurul GC\\scriptPython\\GC-importPyQt',
>>  'C:\\Users\\Nurul GC\\scriptPython\\GC-importPyQt']
>> 212 INFO: checking Analysis
>> 212 INFO: Building Analysis because Analysis-00.toc is non existent
>> 213 INFO: Initializing module dependency graph...
>> 227 INFO: Caching module graph hooks...
>> 246 INFO: Analyzing base_library.zip ...
>> 7679 INFO: Processing pre-find module path hook   distutils
>> 7681 INFO: distutils: retargeting to non-venv dir 'c:\\users\\nurul
>> gc\\appdata\\local\\programs\\python\\python38\\lib'
>> 18693 INFO: Caching module dependency graph...
>> 19096 INFO: running Analysis Analysis-00.toc
>> 19175 INFO: Adding Microsoft.Windows.Common-Controls to dependent
>> assemblies of final executable
>>   required by c:\users\nurul
>> gc\appdata\local\programs\python\python38\python.exe
>> 19539 INFO: Analyzing Ex01(rotulo_demo).py
>> 19818 INFO: Analyzing hidden import 'PySide2'
>> 20291 INFO: Processing module hooks...
>> 20292 INFO: Loading module hook "hook-distutils.py"...
>> 20295 INFO: Loading module hook "hook-encodings.py"...
>> 20632 INFO: Loading module hook "hook-lib2to3.py"...
>> 20666 INFO: Loading module hook "hook-pydoc.py"...
>> 20668 INFO: Loading module hook "hook-PyQt5.py"...
>> 20980 WARNING: Cannot read QLibraryInfo output: raised Expecting value:
>> line 1 column 1 (char 0) when decoding:
>> False
>> 20980 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
>> 20982 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
>> 20983 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
>> 20984 INFO: Loading module hook "hook-PySide2.py"...
>> 21376 WARNING: Cannot read QLibraryInfo output: raised Expecting value:
>> line 1 column 1 (char 0) when decoding:
>> PySide2/__init__.py: Unable to import shiboken2 from , C:\Users\Nurul
>> GC\scriptPython\GC-importPyQt, c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\sit
>> e-packages, c:\users\nurul
>> gc\appdata\local\programs\python\python38\python38.zip, c:\users\nurul
>> gc\appdata\local\programs\python\python38\DLLs, c:\users\nurul gc\a
>> ppdata\local\programs\python\python38\lib, c:\users\nurul
>> gc\appdata\local\programs\python\python38, C:\Users\Nurul
>> GC\AppData\Roaming\Python\Python38\site-packages,
>>  c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\site-packages\win32,
>> c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\site-packages\win32\l
>> ib, c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\site-packages\Pythonwin
>> False
>> Traceback (most recent call last):
>>   File "c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\runpy.py", line 194, in
>> _run_module_as_main
>> return _run_code(code, main_globals, None,
>>   File "c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\runpy.py", line 87, in
>> _run_code
>> exec(code, run_globals)
>>   File "C:\Users\Nurul
>> GC\AppData\Local\Programs\Python\Python38\Scripts\pyinstaller.exe\__main__.py",
>> line 7, in 
>> #
>>   File "c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\__main__.py",
>> line 114, in run
>> run_build(pyi_config, spec_file, **vars(args))
>>   File "c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\__main__.py",
>> line 65, in run_build
>> PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
>>   File "c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\build_main.py",
>> line 734, in main
>> build(specfile, kw.get('distpath'), kw.get('workpath'),
>> kw.get('clean_build'))
>>   File "c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\build_main.py",
>> line 681, in build
>> exec(code, spec_namespace)
>>   File "Ex01(rotulo_demo).spec", line 6, in 
>> a = Analysis(['Ex01(rotulo_demo).py'],
>>   File "c:\users\nurul
>> gc\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\building\build_main.py",
>> line 244, in __init__
>> self.__postinit__()
>>   File "c:\users\nurul
>> 

[PyInstaller] Re: How to include a directory of files when makine onefile

2020-07-06 Thread bwoodsend


Hi,

Firstly I suggest to use --onedir (the default) instead of --onefile to 
debug then switch back to --onefile once it’s working. --onefile does 
everything --onedir does but hidden in a temporary directory so you can’t 
see anything that’s happening. With --onedir mode, you’ll be able to 
navigate into the dist folder and check if/where your files have been 
included.

I’m assuming your project structure is as follows. Correct me if it’s 
different:

+-- game.py
+-- images
|+-- image1.png
|+-- image2.jpg
+-- sounds
|+-- noise1.wav

And your shell/cmd prompt is in running in the same folder as game.py.

Secondly, as you’re a beginner I want to be sure you know how to use 
external files portably in regular non-PyInstaller Python without making 
any assumptions about the current working directory. Something like this 
 is the usual method. Test yours by cd 
ing to a different folder, then running python /full/path/to/game.py. If it 
works then you’re ready to start using PyInstaller.

Your guess pyinstaller --add-data "img/";"img" game.py is the correct 
syntax and it should work. The *DEST* is where inside your application it 
to go relative to the app's root (this will make more sense once you’ve 
used the --onedir option). The quotes are unneeded unless you have names 
with spaces and you have to use : instead of ; on macOS. 

Let us know if you're still getting stuck,

Brénainn

-- 
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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/384f8702-1f02-49f9-95ca-4ba5e862c5cfn%40googlegroups.com.


[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:
>> .
>>