Jump to content
djxandytche

Python freezes when running a certain script

Recommended Posts

Hello,

 

I work on developing software that uses DataSnap.

On the client I am creating this simple Python script:

import pandas as pd
print('done')


Just to illustrate, here is the screen where I enter the script:
image.thumb.png.02ec8bb7ceaa9721faa6a827d589f2ba.png

 

This script is submitted to the DataSnap server to be executed in Python.
Just to illustrate, this is the snippet of code that executes it:
image.thumb.png.6b30db27d8e19d43830f648533ec50fa.png
When the line "GetPythonEngine.ExecString(UTF8Encode(sFormula));" is executed, the program freezes.
And it just sits there without doing anything (there is no processor consumption).
You need to end the process to end execution.


The problem only occurs if the line "import pandas as pd" exists.

 

As the DataSnap server receives multiple requests (multi-thread), I am following the recommendations/rules for working with multi-threads with Python/P4D.


Other scripts, including more complex ones, work normally, as long as the "import pandas as pd" line does not exist.


I did the same test in Visual Studio Code and it works normally:
image.thumb.png.afdf202756d5d1de109e1bda3e47b0a5.png

 

I tried to reproduce this problem outside of my DataSnap project, but I was unable to do so.
When doing this in a simple example project (even within a thread), it works normally.
Therefore, I cannot send an example project so that the problem can be reproduced there.


I searched the posts here for a problem similar to this, but I didn't find anything.

 

Is it possible to help me with this?

Share this post


Link to post

I do not know if this helps but see

In my case, the behavior changed using Microsoft Visual Studio 2019 for Python

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×