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

frequently hangs #910

Closed
jodyhey opened this issue Oct 15, 2018 · 37 comments
Closed

frequently hangs #910

jodyhey opened this issue Oct 15, 2018 · 37 comments

Comments

@jodyhey
Copy link

jodyhey commented Oct 15, 2018

pyscripter hangs pretty frequently - just hangs and will not respond. It does this one to three times a day (I develop or review code for about 4 hours a day)
Running x64 version, with python 3.6.5 anaconda distribution. remote engine
using a lot of numpy, scipy and matplotlib.

@pyscripter
Copy link
Owner

pyscripter commented Oct 15, 2018

Does this happen while running/debugging scripts? What happens when it hangs. Do you get an error report? Do you have to kill it from the Task Manager?

One thing to try when this happens. Go to the Task Manager and in the Details tab find a process named "Python". Right-click it and select "End task". Does PyScripter recover after that?

Any other info about what might cause this and help trace and resolve the issue would be helpful.

@jodyhey
Copy link
Author

jodyhey commented Oct 16, 2018

Sorry I was not more clear. What happens in each of these instances is that Pyscripter is waiting for something. The pointer is replaced by a small spinning thing. I've tried waiting for awhile (e.g. 1/2 hour), but to no avail. I kill it just by clicking on the 'x' in the upper right corner.

@pyscripter
Copy link
Owner

pyscripter commented Oct 16, 2018

Which version of PyScripter are you using?
And let me repeat my question: Does this happen when running or debugging scripts or at some other seemingly random point in time, for instance while typing in the editor?

Also could you please try when this happens: Go to the Task Manager and in the Details tab find a process named "Python". Right-click it and select "End task". Does PyScripter recover after that?

@jodyhey
Copy link
Author

jodyhey commented Oct 17, 2018

The most common circumstance, is when I return to pyscripter in the morning and it will not respond. It also hangs this way sometimes when I have been debugging/editing.

So upon returning to my desktop this morning I returned to pyscripter to find it would not respond and had a the spinning circle.
There are three python.exe tasks listed in details. One with 11 gigs listed under Memory. The other two had much more modest memory values.

When I ended this task in task manager, pyscripter remained open and is still hung (though now the screen is opaque and it says "not responding at the top".

I then ended the second python.exe task, with no change in pyscripter.
I then ended the third python.exe, again with no change in pyscripter.

hope that helps.

taskmanager

@jodyhey
Copy link
Author

jodyhey commented Oct 17, 2018

oh and I'm running pyscripter 3.4.2.0 x64

@pyscripter
Copy link
Owner

Thank you for the information. However, it is kind of hard to figure what where to search for the problem. If I understood what you said, this does not appear to be related to running or debugging scripts. You also stated that you are using the remote engine and I guess you are reinitializing before each run (which is the default).

So if you can provide any more clues about the possible cause do come forward. For instance,

@jodyhey
Copy link
Author

jodyhey commented Oct 17, 2018

not pandas (I use it but not a lot) and definitely not geopandas
code completion page screenshot attached
I'm not using remote files much, python.exe and scripts are local
Not seeing any dependency on the kind of scripts. Mostly they are number crunching and some plotting.

One thing - I have fallen into frequently using the interpreter window while debugging, where I enter statements into the interpreter window for evaluation, when pyscripter is stopped at a break point in the code. And then I'll resume the debugging session.
I'm not sure how/why this works, but its a nice feature if indeed it is intended to be so.

hope some of that helps

@jodyhey
Copy link
Author

jodyhey commented Oct 17, 2018

here is code completion page
image

@dunha
Copy link

dunha commented Oct 25, 2018

I have also notice this issue.
Using 3.4.2 32 bit on Windows 10 Python 2.7.13
Usually occurs while Pyscripter is in the background. Hasn't happened to me while in use so far.
It even occurs if no script has been run or edited after some time in the background
It will terminate with the close button but not close as intended. Haven't had to use task manager.
I thought it might be because of so many scripts open, but occured with just one open
I don't have mapped network drives but I do have UNC shortcuts in Explorer. Pretty much all scripts are on the local drive.

@pyscripter
Copy link
Owner

I wonder whether it relates to this: https://stackoverflow.com/questions/20142166/explain-errors-from-getkeystate-getcursorpos/20142404?sgp=2#20142404 .

I found the following situations which might likely trigger these errors:
-Login after user switching in Windows
-Login from password protected screensavers
-VNC / Remote Desktop Services

I will try to add a workaround in the next version.

pyscripter added a commit that referenced this issue Oct 25, 2018
@pyscripter
Copy link
Owner

Added potential fix in version control.

@dunha
Copy link

dunha commented Oct 26, 2018

Thanks. I hadn't noticed this in previous versions

@marshall-ucsd
Copy link

Still a serious issue in 3.5.1. No clear trigger. Just now I started typing "de" to create a new class method (at the top of an existing class), and it's locked up. Left it a little to see if it comes back, but ultimately had to force-stop it.

It was open for hours before the hang, off-and-on editing.

Win 7 Pro, Python 3.6.7 x64 - Using virtual environment (which might be important?)

@philnagel
Copy link

I am also experiencing this on 3.5.1.

@pyscripter
Copy link
Owner

pyscripter commented Dec 22, 2018

I have introduced some changes that may resolve the "random" crashes of PyScripter. Could you please try the executable in this zip file. Just replace your PyScripter.exe with the one inside the zip file and report back whether the errors still occur.

@pyscripter
Copy link
Owner

The above update has been reported to resolve this issue.

Here are updated links to the 32 bit and 64 bit executables (3.5.2 preview)

Could you please test with regard to this issue.

A lot of features have been added, so please report any other issues that you may find. This will help make the next release more robust. Here is the main changes:

History: v 3.5.2

@jodyhey
Copy link
Author

jodyhey commented Jan 4, 2019 via email

@UnderJollyRoger
Copy link

I am having the same hanging issue after updating to v3.5.1 (32bit)/Python 2.7.13. I haven't tried the update with Python 3x because I'm using the arcpy module, which only runs on Python 2.7. When I run a script it produces the expected results with no errors, but in the Interpreter it hangs on the first print statement and never completes. When I hit the close button I get this message:
image

I've been following this thread and have used the updated 32 bit executable. No change.

@UnderJollyRoger
Copy link

One thing to try when this happens. Go to the Task Manager and in the Details tab find a process named "Python". Right-click it and select "End task". Does PyScripter recover after that?

Any other info about what might cause this and help trace and resolve the issue would be helpful.

I went into the Task Manager and tried this. I right clicked on Python.exe ---> End Task
It recovered. Here's the output in the Interpreter:
py

@pyscripter
Copy link
Owner

@UnderJollyRoger This is a rather different issue from the one discussed in this thread.

The problem in your case is that the script you are running somehow breaks the communication with PyScripter.

  • Does this occur with any script (say print("HI")?
  • If not can you post a simple sample script that reproduces the issues.

@UnderJollyRoger
Copy link

Thanks for the quick response.

  • No, it does not occur with print("hi")
  • I can't seem to reproduce the issue? I've tried a few other scripts with and without the arcpy module and they all completed. It seems to only be one particular script. Funny, because it never had an issue before the Pyscripter update.

@pyscripter
Copy link
Owner

@jodyhey Any feedback?

@philnagel
Copy link

I have also experienced this hanging issue, and have been testing both of the updated executable files daily since you have posted them. I did not see the issue until today again for the first time, in the 64 bit version. I have not been working with the 32 bit a lot, though.

@pyscripter
Copy link
Owner

@jodyhey Could you please turn the new IDE option Tools, Options, IDE Options, File Explorer, Background Processing to False and report whether it makes things better?

@dunha
Copy link

dunha commented Jan 14, 2019

I haven't had problems since I set the explorer background processing as suggested (couple of days) - using 3.5.1 32 bit
Also not having issues with swapping remote engines any more (issue #880) but don't think that is related
Haven't tried 3.5.2 as I can't find a portable version
Tried using WingIDE in the meantime but didn't like it as much as PyScripter

@duyduc27
Copy link

I got the same problem. At first, I used 3.5 x64 version then uninstall and reinstall 3.6.0.0 x64 version instead. I didn't add much libraries, just clicking and coding but the IDE was frequently hung many times. Then I have to close the program by using Task Manager. My OS system is Window 7 Ultimate SP 1.

@pyscripter
Copy link
Owner

Which version of python? Are you be any chance using files with non-ascii file paths?

@duyduc27
Copy link

duyduc27 commented Feb 15, 2019

Which version of python? Are you be any chance using files with non-ascii file paths?

My python version is 3.7.0 . I didn't use files with non-ascii but you have the point, I usually switch "keyboard tool" to use my Vietnamese characters. May it caused that problem because I was careless and typed Vietnamese character in a chance?
By the way, I tried to use pyscripter 3.5 version instead. Then it keep saying that could not connect to the remote Python engine server.

@ghost
Copy link

ghost commented Mar 4, 2019

Same issue. I'm also doing everything possible wrong:

  1. non-ascii file paths all over the place
  2. All files are utf-8 and most include non-ascii characters
  3. some paths use symbolic links and/or junctions
  4. fallback non-unicode language is shift JIS
  5. Language bar active and typically switch between four different languages

When the hang occurs language bar's language indicator will disappear, like when you start a program and no language is specified. Killing python does nothing.
I think tooltips are what's setting it off. When all features generating handy tooltips are disabled the only condition that causes a hang is a language switch. The delay is about right too.

In low available memory situations the remote debugger will also disconnect and may or may not reconnect if you keep kicking it. It may cause a hang, but that's probably unrelated to the overall issue. That can be recovered by killing any python processes, though you're really better off just restarting the IDE in general after closing whatever (dozen) things are eating that ram.

@dDoid
Copy link

dDoid commented Jun 23, 2019

I too had this problem.
Pyscripter v3.6.0.0 x64, remote engine
Python 2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:37:19) [MSC v.1500 64 bit (AMD64)] on win32

When running some scripts using the run button, the script would hang.
The only way of getting out of this was to renitialise the python engine.

The same script would run using the internal engine.

In the uk we use a console page of 850, active code page of 1252.
I seem to have problems involving characters where the encodings are diffferent i.e.
in code page 850, chr(20), chr(156), chr(170), ie pilcrow, pound, negation characters

In a short interactive session the session hangs in a similar way.
This occurs when attempts are made to display a line containing a syntax error with one of these
characters are in it, even if only in the comment.

`*** Remote Interpreter Reinitialized ***

print "a" #
a
print "a"" #
File "", line 1
print "a"" #
^
SyntaxError: EOL while scanning string literal
print "a"" #b
File "", line 1
print "a"" #b
^
SyntaxError: EOL while scanning string literal
print "a"" #£`

The session just hangs after the £.
In interactive mode, the expected message appears.

I now move on the an example script encoded in 1252.

#!coding:1252
import sys
p = "a"
up = p.decode("1252")
print "{} : {:02x}".format(p, ord(p))
print up

This worked fine.
But changing the line
p = "a"
to
p = "£" (pound sign, chr(163))
would cause it to hang.

I then reasoned that it could be that the python interpreter was actually putting out a message but
was getting stuck in rpcy, so I added a sys.stdout.flush() after each print.
It worked!

Hope this helps.

@pyscripter
Copy link
Owner

@dDoid
I have reproduced the problem and working on it. That was helpful.

@pyscripter
Copy link
Owner

@dDoid The error you have reported has been fixed. The fix will be available in the next version. So PyScripter will no longer hang in the cases you mention.

Please note that the default encoding in python 2.x is ascii. The coding comment affects only the encoding of the source code and not the python encoding used to convert sting literals to unicode. So the correct way to print £ is the second statement.

#!coding:1252
print "£"
print u"£"

pyscripter added a commit that referenced this issue Jul 9, 2019
@dDoid
Copy link

dDoid commented Jul 11, 2019

Thank you for your efforts.

I was aware of the use of the coding statement. I encoded the file in 1252 as I know this is what pyscripter expects.

I agree that in an ideal world print u"£" would be the preferred option.
But when you want to redirect / pipe the output, sys.stdout.encoding is set to None, python uses defaultencoding - ansi - 7bit. Any attempt to print the unicode codepoint of a character in the bottom half of the cp850 table will then blow up.

@pyscripter
Copy link
Owner

I am closing this since this is based on a few versions old PyScripter. Please open a new issue if you have similar problems with PyScripter 3.6.2 or later.

@Llamero
Copy link

Llamero commented Oct 14, 2020

I am having a similar issue with PyScripter 3.6.4.0 x64 running on Windows 10 x64. The window spontaneously hangs for about 5-20 seconds about every 10 minutes or so. I have not noticed it hanging while I am running code, but it does hang while typing code. It seems to hang most often when changing from another window back to PyScripter. I've also left Resource Monitor up, and when PyScripter hangs it doesn't seem to increase the CPU usage at all. It have never terminally hung, and will clear itself if given enough time.

Thank you for all of your work on this.

@dougbrowning
Copy link

Came here to say me too! 3.6.4.0 x86 on WIndows 10. Python 2.7.16

It seems related to the script being on a network drive. I have to copy the .py local and it helps. It sometimes sits right away and does nothing. Not really hanging just not doing anything. Other times it will do the first print then just sit.

Today now it started just not showing the prints but actually running in the background. I eventually ended it and then found out it had worked but was just sitting. Also today when it does run it will do one print, then sit, then all of sudden all the prints come at one and the script is done.

I have to use the old Python for ArcMap so I am stuck. thanks

@miky1007
Copy link

miky1007 commented Mar 2, 2023

I'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!

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