Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyinstaller ERROR #276

Open
mikilterribile opened this issue May 8, 2024 · 2 comments
Open

pyinstaller ERROR #276

mikilterribile opened this issue May 8, 2024 · 2 comments

Comments

@mikilterribile
Copy link

Hy everyone, this is for real my last message. I had been trying for hours seeking for a solution but nothing.

I have created a nice code for running anuga with shapefiles and raster that can be directly taken as outputs of a GIS-program. The code runs correctly in each reasonable scenario and allows to easily simulate flooding events with solid transport, riverwalls, structures, culverts ecc...

Now I want to build an executable file with my work, in order to use it in each computer I want and eventually share it with other interested people.
In order to do that, I've freezed my python code and my evnironment using 'pyinstaller'.

The problem starts now. When I run my executable file with a hydraulic problem, while anuga creates the domain it raises an error: "'NoneType' object has no attribute 'write'". The mesh file is not even generated. I think the error is here around, maybe, because in the log file the last written words are:

"2024-05-08 19:56:51,922 CRITICAL mesh_interface:108 |Resource usage: total memory=8101.2MB free memory=1725.5MB
2024-05-08 19:56:51,925 INFO mesh_interface:108 |#@# sys_platform, win32
2024-05-08 19:56:51,929 INFO mesh_interface:108 |#@# start_total_memory, 8101.22265625
2024-05-08 19:56:51,932 INFO mesh_interface:108 |#@# start_free_memory, 1725.5234375
2024-05-08 19:56:51,936 INFO mesh_interface:110 |#@# maximum_triangle_area, 1000.0
2024-05-08 19:56:51,941 INFO mesh_interface:112 |#@# minimum_triangle_angle, 28.0
2024-05-08 19:56:51,945 INFO mesh_interface:115 |#@# startMesh, '2024-05-08 19:56:51'
2024-05-08 19:56:51,952 CRITICAL mesh_interface:373 |Generating mesh to file 'C:\Users\miche\AppData\Roaming\hydrogis\program_data\projects\fersina\idrodinamica\mesh_file.msh'"

NB: The same identical hydraulic problem gives no errors running my python code with Pycharm.

Thanks in advance for any kind of support, Best regards,
Michele Zucchelli.

@stoiver
Copy link
Member

stoiver commented May 9, 2024

@mikilterribile could you also provide the full error message. Hopefully that will indicate where the error is being produced. It could be caused by some conflict in the environment created by pyinstaller

@mikilterribile
Copy link
Author

It seems to be I found the solution. The error was due to the "pprint" statement in the mesh generation. pprint needs to a default console where to print the values and using an executable file maybe the default console is "None". So I simply removed the "verbose" option (verbose = False) in the "create_domain_from_regions" function and now it seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants