Results 1 to 5 of 5

Thread: Fatal Python error after executing Chapter 4 example 1 tutorial

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    3

    Fatal Python error after executing Chapter 4 example 1 tutorial

    Using PyIMSL studio 1.5, I get an error at the end of running the first tutorial (chapter 4, Example 1):


    Fatal Python error: PyEval_RestoreThread: NULL tstate

    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.



    I have tried using the default Python 2.6 project setting as well as 2.5 and see the behavior in both cases. Any pointers?

    Thanks,
    Nick

  2. #2
    Can you say more about

    a) Exactly how you ran the code
    b) What interaction you had with the IPython/Python prompt or graphics, if any, before the crash
    c) What operating system are you running on
    d) Are you using the full PyIMSL Studio install, or just various components you chose to install into an existing Python (2.6 it sounds like) distriubution

    This will help others on the Forum get a better sense of what is going on

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    3
    Quote Originally Posted by totallyunimodular View Post
    Can you say more about

    a) Exactly how you ran the code
    b) What interaction you had with the IPython/Python prompt or graphics, if any, before the crash
    c) What operating system are you running on
    d) Are you using the full PyIMSL Studio install, or just various components you chose to install into an existing Python (2.6 it sounds like) distriubution

    This will help others on the Forum get a better sense of what is going on
    a) Now how did you run the example?
    I am using Eclipse .. which I would imagine would be fairly common for people looking at PyIMSL studio. I tried two methods, first, I copied the code from the getting started guide and ran it. When I got the error, I then tried creating a new PyIMSL project following the steps in the getting started guide, and then imported the chapter4_example1.py file into that project. Running it got the same error.

    b) What interaction you had with the IPython/Python prompt or graphics, if any, before the crash
    The code runs to the end before crashing. If I debug and put a breakpoint at the end, all 3 windows stay up, and the crash doesn't occur until the end of execution.

    d) Are you using the full PyIMSL Studio install:
    Yes, I'm using the Eclipse that came bundled with PyIMSL studio and made no modifications to that. The Eclipse that came with PyIMSL studio?s default Python grammar version under "PyDev->project type" is version 2.6. However, I tried both 2.6 and 2.5 and got the same error.

  4. #4
    The key here is running this under Eclipse, which is the same as running as a program with the command "python chapter4_example1.py". However, these examples are designed to be run interactively, either by cutting/pasting into a python session or using the command execfile('chapter4_example3.py'). This code matches the code in the User Guide Tutorial chapter which documents an interactive session.

    In order to run non-interactively in Eclipse two changes are necessary:

    Comment out the line at the top:
    Code:
    # interactive(True)
    Add this command at the bottom to force the display of the graphs:
    Code:
    show()
    Now these files can be run like a normal python program or in Eclipse.

  5. #5
    Junior Member
    Join Date
    Feb 2010
    Posts
    3
    Quote Originally Posted by Steve View Post
    The key here is running this under Eclipse, which is the same as running as a program with the command "python chapter4_example1.py". However, these examples are designed to be run interactively, either by cutting/pasting into a python session or using the command execfile('chapter4_example3.py'). This code matches the code in the User Guide Tutorial chapter which documents an interactive session.

    In order to run non-interactively in Eclipse two changes are necessary:

    Comment out the line at the top:
    Code:
    # interactive(True)
    Add this command at the bottom to force the display of the graphs:
    Code:
    show()
    Now these files can be run like a normal python program or in Eclipse.

    Great, commenting out the "interactive(True)" fixes the problem and the "show()" leaves the graphs displayed. So, everything is fixed now. Thanks for the help!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •