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

pyscripter hangs #1028

Open
jodyhey opened this issue Oct 13, 2020 · 20 comments
Open

pyscripter hangs #1028

jodyhey opened this issue Oct 13, 2020 · 20 comments

Comments

@jodyhey
Copy link

jodyhey commented Oct 13, 2020

After I run this code, and then try to enter text or use the ide, pyscripter hangs. Sometimes it resumes within 3 or 4 minutes, sometimes not. The data frame size is (3219,3) and there is plenty of ram and diskspace.

from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
fn = r"E:\genemod\better_dNdS_models\Enterobacteriales\9_28_2020\fpkm\ecoli_fa1_fpkm.txt"
df = pd.read_csv(fn,sep="\t")
fpkm = np.array(df['fpkm'])

bins = []
num_bins = 12
data_points_per_bin = len(fpkm) // 12

binned = [fpkm[_ * data_points_per_bin: (_+1)*data_points_per_bin] for _ in range(num_bins)]

@pyscripter
Copy link
Owner

Thanks for the bug report. Is it possible to make the data file available to me, so that I can replicate the exact same issue you are facing?

@jodyhey
Copy link
Author

jodyhey commented Oct 14, 2020 via email

@pyscripter
Copy link
Owner

pyscripter commented Oct 14, 2020

You can drag&drop from the File Explorer instead of copy & pasting. What was pasted was just 2668 rows. So it does not much the the data frame size (3219,3) you mentioned. I will try with that anyway or you may want to insert as a file the full data set.

Could you also state:

  • Python version
  • PyScripter version

@jodyhey
Copy link
Author

jodyhey commented Oct 14, 2020

Now I am doubting that that code triggered the problem. Pyscripter is hanging - i.e. pausing for a couple minutes - each time I try to edit or do anything. I suspect it is not interacting well with the fact that I have 20 fairly intensive (lots of file io) jobs running in the background (windows pc, 48 cores). Ordinarily this does not cause a problem, but now those other jobs are reading and writing to files that are on a new remote drive, and since that change Pyscripter is hanging as described.

Does that make any sense? If so is there a way to disentangle Pyscripter from the other stuff?

@pyscripter
Copy link
Owner

Try disabling the File Change notification and see whether it helps.
Tools, Options, IDE Options, IDE, File change notification, fcnDisabled.

@pyscripter
Copy link
Owner

pyscripter commented Oct 16, 2020

I have tried you script with the provided data and I could not replicate the issue. Please try the suggestion above and report whether it makes any difference.

@Llamero
Copy link

Llamero commented Oct 23, 2020

I've been having the same issue, and tried the solution you proposed but still get the IDE hanging pretty frequently. I am running PyScripter 3.6.4.0 x64 running on Windows 10 x64 with Python 3.8.3 64-bit. The IDE seems to hang mostly when switching back to the IDE window, or when first trying to type new code after a pause. Sometimes it also seems to get stuck in a loop where it flickers between having the window selected and not selected.

I also found that there is no increase in demand on the CPU.

One other detail, the hanging happens after the first few key strokes rather than immediately. For example, in the most recent hanging I clicked from a spreadsheet window back to the IDE tried to type "score" and the IDE printed "sco" and then hung for about 10 seconds and then printed "re".

I should note that the hanging is not always when transferring between windows, the IDE will also hang when staying in the IDE window.

@kingstairs
Copy link

kingstairs commented Nov 24, 2020

I am seeing the same issue - IDE hangs, frequently, for a significant amount of time, when just typing. Disabling File Change notification, as suggested above, has no impact. PyScripter 3.6.4.0 x64 on Win 10 x64, Python 3.8.6 x64 (venv, activated).

I disabled Code completion as you type - no effect.

Just now I launched PyScripter, opened a file, checked settings (for this message), and tried to type a comment - hang for ~30s. Then I seem to be able to type normally...

One thing I just discovered - I switched to another open file (first access this session), and when I tried to start entering a method documentation, it locked up again (~30s, again, then no problem). But then I switched to another file (again, first access this session), no issues. None of these Python files are large (largest was 360 lines).

What's really annoying about this bug is that it is impossible to replicate on-demand, which make me wonder if a background worker thread or timer, something asynchronous, is causing the problem. Possibly something in the editor control's code, triggered on first displaying a source file, or the Code Explorer (tab not current active) re-parsing the file?

EDIT #1:
I created a new script and started editing - so far no lock-ups. This script is only importing module cmd, but the code mentioned above (that had hanging problems) had quite a few imports. Maybe the complexity of the import tree is a factor?

I also notice that if I hover the cursor over a symbol, I get a definition tooltip, despite disabled code completion. So some kind of parsing/scanning is still being done (or maybe I have to disable other options for this test?).

Hope that helps, or at least triggers an idea... 😉

@pyscripter
Copy link
Owner

@kingstairs Thanks that is useful. I will have another go at it.

@kingstairs
Copy link

Any progress on this, or anything we can do to help investigate this?
This specific bug is making using PyScripter periodically annoying at best to all but unusable at worst, so it really needs to be squashed once and for all.
FWIW, this problem did not exist at all (AFAICS) before a few releases ago - sorry I cannot be more specific, other than I do not recall it happening prior to the 2.6.x releases. I hope someone else can help narrow that down, to reduce the number of changes to review.

Since it only triggers when you're typing, I feel that this is linked to something like background parsing and/or complete as you type.

@neonhamster
Copy link

I have the same problem. Today I started migrating from WinXP/Python2 to Win10/Python3, installed Python 3.6.0 and Pyscripter 3.6.4.0 64 and see the same behaviour as described here and in the last comment (Llamero, 15 Oct 2020) of issue #910.

@DrCKYHC
Copy link

DrCKYHC commented Mar 8, 2021

Following information could be useful (even if the use-case by current Issue is a bit different).
First about my System:

  • Windows 10 64x
  • PyScripter-3.6.3-x64
  • Python was updated from 3.3.5 to 3.8.7 (both x64)

I got a reproducible freezing of pyScripter directly after update of Python version.
First the app was showing at startup a Pop-Up Window that it can't find the python. Interesting is that I was not able to click Ok at the PopUp so it was already "hanging" that time (so I have closed the app completely).

Then I have checked:

  • the python environment variables (PYTHONPATH and PYTHONHOME - both were Ok)
  • the PATH environment variable itself (it was already containing correct paths for new python)
  • command-line arguments by pyScripter (i.e. --PYTHON33 and --PYTHONDLLPATH - they were NOK, so I have removed them first)
  • the file PyScripter.local.ini (this one was referencing to old version & paths, so I have adapted it too, i.e. the sections [PythonVersions-x64\Custom Versions] and [PythonVersions-x64])

After change of named parameters - the pyScripter has started (and python interpreter window has shown correct new python version), but shortly after showing the drives in the File Explorer it get frozen "forever".
Restart of application doesn't help - PyScripter freezes directly after its start.
I thought first - it can't find the previously opened python script (it was indeed no more available) and removed it from PyScripter.ini , but this doesn't help.

Finally I have re-started the PC and started the pyScripter as one of the first applications. And this time a Windows Defender has asked that the Python 3.8 (not the PyScripter itself) tries to use some network connections, which were blocked by Defender and defender asks whether the connections should be allowed (as usual - for different arts of network-connections, i.e. Public, Private, Domain, etc.). First after allowing the connections in Windows Defender - the PyScripter starts to work properly without named freeze.

Theoretical - similar problem could be a root cause for other freezes of PyScripter - also by current Issue (i.e. if some Defender, or Firewall, or Antivirus blocks the python connection, which being awaited by PyScripter - this blocks the PyScripter itself).

I know - the python functionality is not in "direct responsibility of PyScripter, but as improvement for IDE-tool I would suggest following:

  1. Add a watchdog (a timeout could be configured in ini-file) which will unblock PyScripter in case of waiting for python-reply more then given timeout (if specified)
  2. "Unbind" the rest of PyScripter GUI from waiting of python-reactions.
    Yes -it's clear that the python-interpreter could not be really "disconnected" from python, but it should be only one sub-window which could get frozen (with possibility to cancel/interrupt the related thread/process by user). The rest of the GUI should be independent on processes in background.
    For example - if the pyScripter can't find the python (and probably tries to search through network/internet for update or python itself) - it's not a reason that GUI get blocked! With blocked GUI you can't change path to python in "normal way".
    The tool become to be useless when GUI get blocked directly after start of the tool.

@pyscripter
Copy link
Owner

@DrCKYHC Thanks for the detailed report and suggestions. These are exactly the changes I am currently working on for the next release...

@andrzejmay
Copy link

Any update to this? It has made the IDE unusable...

@pyscripter
Copy link
Owner

Please see the blog post and try the new version. Significant work has been down to address this issue.

Just download the registry free installation unzip and run PyScripter.exe. It will not interfere with your current installation.

Feedback, specific to this issue but also more general will be most welcome.

@neonhamster
Copy link

neonhamster commented Apr 22, 2021 via email

@Creative-Ataraxia
Copy link

I'm on pyscripter 4.1.1.0 x64. Still having the 15 second - 30 seconds-ish hang problem. Curiously, most commonly when I'm pressing the "end" key, i.e. type print() -> press "end" key, pyscripter hangs.

This is under conditions where I'm almost drawing no recourses at all

@DrCKYHC
Copy link

DrCKYHC commented Mar 22, 2022

There was also another issue related to freezing of the GUI (using the version 4.1.1.0 ):
I have several paths on company-network mapped as a network-drives.
Correspondingly the drives being shown in File-Explorer within PyScripter and - when started - PyScripter file-explorer tries to enumerate the drives, this causes a "freeze" for few minutes.
To improve the behavior - after the GUI get unfrozen - I've:

  • enabled the "File Explorer Background Processing" (i.e. run it as a separated process/thread):
    Tools -> Options -> IDE Options -> File Explorer -> File Explorer Background Processing -> Set to "True"
  • Closed the File Explorer in the View (actually I don't need it visible per Default for my use-cases)

Additionally in the PyScripter.ini I have changed following values which might help regarding freezing-behavior:

  1. in the [IDE Options] group:
  • TimeOut=60000
  • RestoreOpenProject=FALSE
  • ProjectExporerInitiallyExpanded=FALSE
  • AutoCheckForUpdates=FALSE
  • AutoReloadChangedFiles=FALSE
  1. in the [Editor Options\Options] group:
  • eoDragDropEditing=FALSE
  1. in the [Interpreter Editor Options\Options] group:
  • eoDragDropEditing=FALSE

Hope it might help...

@miky1007
Copy link

miky1007 commented Mar 2, 2023

'm using "Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:43:28) [MSC v.1934 32 bit (Intel)] on win32." and Pyscripter 4.2.5.0 x86 (which I appreciate!). Unfortunately it gets stuck frequently, but only during debugging and when I try to write something , in the interpreter (when execution stops at some breakpoint).
My OS is Windows 10 version 21H2. THe only way to get back to work is terminating the job in task manager.
It's pretty annoying, and I don't want to switch to another IDE, because, i repeat I like Pyscripter very much!

@retsyo
Copy link

retsyo commented Jul 3, 2023

@miky1007
the author has supplied a new one in #1212 , can you test it? Thanks
PyScripter.exe v4.2.8-x64

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

No branches or pull requests

10 participants