tpaviot / pythonocc-core

Python package for 3D geometry CAD/BIM/CAM
GNU Lesser General Public License v3.0
1.37k stars 378 forks source link

Is is possible to pack pythonocc to exe file? #653

Open ecila92 opened 5 years ago

ecila92 commented 5 years ago

Hi guys! I need help with packaging my pythonocc program containing pyQt5 I tried to make exe file with pyinstaller but the exe file does not works and this warning massage comes out when I try to start exe file.

File "tesetui_2.py", line 27, in ImportError: No module named 'core_geometry_face_recogition_from_stepfile' [22140] Failed to execute script tesetui_2

I think this is causing because there is no hook file for pythonocc and oce core. I tried to build the hook file for pythonocc, but it was too hard for me as just a student...

Can anyone tell me how to make exe file from .py containing pythonocc and pyQt5... There is no need to use pyinstaller, any program will do fine! Thank you!

waterbug commented 5 years ago

1)  Google (or duckduckgo, or other favorite search engine ...) is your friend.

2)  There are a lot of suggestions about pyinstaller and pythonocc buried in the pythonocc issue tracker -- for example:

https://groups.google.com/forum/#!msg/pythonocc/dvdsLLw2REM/-u0_m8OeDgAJ

Some day they will hopefully be extracted into a document by some civic-minded person (maybe me if I ever find time! ;).

Sorry I can't offer a more specific suggestion.  As to how you can get more specific help:  in your message, specify what package manager you are using (pip or conda and what version), and what versions of pyqt and pythonocc.

Steve

On 5/11/19 10:59 AM, ecila92 wrote:

Hi guys! I need help with packaging my pythonocc program containing pyQt5 I tried to make exe file with pyinstaller but the exe file does not works and this warning massage comes out when I try to start exe file.

File "tesetui_2.py", line 27, in ImportError: No module named 'core_geometry_face_recogition_from_stepfile' [22140] Failed to execute script tesetui_2

I think this is causing because there is no hook file for pythonocc and oce core. I tried to build the hook file for pythonocc, but it was too hard for me as just a student...

Can anyone tell me how to make exe file from .py containing pythonocc and pyQt5... There is no need to use pyinstaller, any program will do fine! Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tpaviot/pythonocc-core/issues/653, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFNJEPNZKPJTHDWDIXZCZDPU3NL3ANCNFSM4HMIJ4NQ.

waterbug commented 5 years ago

P.S.  This is an issue-tracker and what you posted is not really an "issue" but a question, so you should be posting to the pythonocc google group:

pythonocc@googlegroups.com

Steve

On 5/11/19 3:16 PM, Stephen Waterbury wrote:

1)  Google (or duckduckgo, or other favorite search engine ...) is your friend.

2)  There are a lot of suggestions about pyinstaller and pythonocc buried in the pythonocc issue tracker -- for example:

https://groups.google.com/forum/#!msg/pythonocc/dvdsLLw2REM/-u0_m8OeDgAJ

Some day they will hopefully be extracted into a document by some civic-minded person (maybe me if I ever find time! ;).

Sorry I can't offer a more specific suggestion.  As to how you can get more specific help:  in your message, specify what package manager you are using (pip or conda and what version), and what versions of pyqt and pythonocc.

Steve

On 5/11/19 10:59 AM, ecila92 wrote:

Hi guys! I need help with packaging my pythonocc program containing pyQt5 I tried to make exe file with pyinstaller but the exe file does not works and this warning massage comes out when I try to start exe file.

File "tesetui_2.py", line 27, in ImportError: No module named 'core_geometry_face_recogition_from_stepfile' [22140] Failed to execute script tesetui_2

I think this is causing because there is no hook file for pythonocc and oce core. I tried to build the hook file for pythonocc, but it was too hard for me as just a student...

Can anyone tell me how to make exe file from .py containing pythonocc and pyQt5... There is no need to use pyinstaller, any program will do fine! Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tpaviot/pythonocc-core/issues/653, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFNJEPNZKPJTHDWDIXZCZDPU3NL3ANCNFSM4HMIJ4NQ.

ecila92 commented 5 years ago

Thank you for your kind suggestion and I'm sorry to post at wrong section T.T please forgive me it was my first time posting something on github and am bit desperate!T.T

Durksz commented 5 years ago

Your question is answered in #553 .

adam-urbanczyk commented 5 years ago

I think it might be interesting for the community to look at a complete working example for a non-trival PyQt app using PythonOCC:

https://github.com/CadQuery/CQ-editor/blob/master/pyinstaller.spec

The trick was to bundle certain files and write a runtime hook that will define OCC specific variables:

https://github.com/CadQuery/CQ-editor/blob/master/pyinstaller/pyi_rth_occ.py

jf--- commented 5 years ago

curious if anyone has tried pyoxidizer which seems to be the new kid in town

adam-urbanczyk commented 5 years ago

Looks interesting indeed, bu no experience on my side.

Durksz commented 5 years ago

The faster startup-time can be a nice benefit! I have not have tried it though