r/learnpython • • 4h ago

How to make this python script faster and able to run?

hey there, i m working on this python script: https://pastebin.com/kknURJij
and the main issue i m facing right now is its not running and i have been stuck in the terminal since so long...
i just want to ask how to make it faster so we can execute it.

Output when i run this script :

```DeprecationWarning: `langchain-community` is being sunset and is no longer actively maintained. See https://github.com/langchain-ai/langchain-community/issues/674 for details and migration guidance toward standalone integration packages.
from langchain_community.utilities import SQLDatabase.```

currently its stuck with this same terminal output.
My pc specs : Mac Air M1, Golden Gate 28

what i have tried :
Tried running on github codespaces but still not running but stuck with the same output.

0 Upvotes

3 comments sorted by

2

u/LayotFctor 2h ago

So is it not running, or is it just slow? What was the last thing you wrote before it stopped? That's probably the issue, did you try removing it?

2

u/CelebrityChess 1h ago

that deprecation warning is harmless, it's not what's freezing things. when a script goes quiet right after the imports it's usually sitting on a slow call, like connecting to the database or waiting on an api request that has no timeout. hit ctrl+c while it's hung and read the traceback, the last few lines show exactly which line it was stuck on. or put a print before each step so you can see where it stops.

1

u/zanfar 3h ago

i just want to ask how to make it faster so we can execute it

You're gonna have to figure out why it's slow before you can improve it. Start with a minimal script, and add features until you reproduce the issue.

What have you done about the depreciation warning?