🌐
Stack Overflow
stackoverflow.com › questions › 71545030 › traceback-most-recent-call-last-im-getting-this-error
python - Traceback (most recent call last): I'm getting this error - Stack Overflow
When you run the interpreter like this and call the input() function, it asks for your input immediately (since it will execute the first line before it even interprets the second line). Then when you paste in the second line, it will think that that's the input it's expecting and crash since it can't convert the string "m1 = int(input('Enter the number of compounding periods for Bank 1'));" This is why you should usually edit your code in a Python file (.py) rather than typing it line by line in the interpreter, since there is no risk of your code being interpreted as input.
🌐
Codeit
codeit.kr › community › questions › UXVlc3Rpb246NWUzNDUyMjU4MGU1MTMzNzNkOTYxYzY5
Traceback (most recent call last): 라는 에러가 뜹니다
def flip(some_list): if len(some_list) < 2: return some_list elif len(some_list) > 2: return flip(some_list[1:]) + some_
Discussions

If i get a "Traceback (most recent call last):" what should i put as except?
Your error is facebook.GraphAPIError so catch that. Alternatively, you can just catch the base class Exception to catch pretty much anything, but is not considered a good practice. More on reddit.com
🌐 r/learnpython
13
10
December 20, 2016
Error "Traceback(most recent call last):"
Hello, I’m trying to make a command prompt thingy. When I try and open it in a preview on PyChamp the code runs fine, but in a regular file it closes, and I was able to see the error Python error Traceback(most recent call last): I know the problem is where I try to import pythonroblox. More on discuss.python.org
🌐 discuss.python.org
0
0
April 4, 2021
Python " Traceback (most recent call last) " - Stack Overflow на русском
0 Ошибка Traceback (most recent call last): (Python) More on ru.stackoverflow.com
🌐 ru.stackoverflow.com
Error : Traceback (most recent call last):
File "C:\Users\Willy\Desktop\B...^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Willy\AppData\Roaming\Python\Python311\site-packages\fire\core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Willy\AppData\Roaming\Python\... More on github.com
🌐 github.com
12
August 6, 2023
🌐
Python Morsels
pythonmorsels.com › reading-tracebacks-in-python
Deciphering Python's Traceback (most recent call last) - Python Morsels
January 3, 2022 - That's why the first line of a traceback says Traceback (most recent call last): "most recent call last" means the most recent level in your call stack is shown last, meaning at the very bottom.
🌐
Python
docs.python.org › 3 › library › traceback.html
traceback — Print or retrieve a stack traceback
February 22, 2026 - *** print_tb: File "<doctest...>", line 10, in <module> lumberjack() ~~~~~~~~~~^^ *** print_exception: Traceback (most recent call last): File "<doctest...>", line 10, in <module> lumberjack() ~~~~~~~~~~^^ File "<doctest...>", line 4, in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ IndexError: tuple index out of range *** print_exc: Traceback (most recent call last): File "<doctest...>", line 10, in <module> lumberjack() ~~~~~~~~~~^^ File "<doctest...>", line 4, in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ IndexError: tuple index out of range *** format_exc, first and la
🌐
Reddit
reddit.com › r/learnpython › if i get a "traceback (most recent call last):" what should i put as except?
r/learnpython on Reddit: If i get a "Traceback (most recent call last):" what should i put as except?
December 20, 2016 -

My "try/except" statement looks like this:

try:
	post_data = graph.get_object(id_list[0]+"_"+id_list[1]+"/comments?limit=800") # change limit depending on the amount of comments (max 5000 i think)
except 

But I dont know what to put in the except part. The error I get (and want to except) looks like this:

Traceback (most recent call last):
  File "parser.py", line 13, in <module>
    profile = graph.get_object("me")
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\facebook\__init__.py", line 105, in get_object
    return self.request(self.version + "/" + id, args)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\facebook\__init__.py", line 272, in request
    raise GraphAPIError(result)
facebook.GraphAPIError: Error validating access token: Session has expired on Monday, 19-Dec-16 08:00:00 PST. The current time is Tuesday, 20-Dec-16 02:38:31 PST.

This dont work except Traceback:

Top answer
1 of 4
7
Your error is facebook.GraphAPIError so catch that. Alternatively, you can just catch the base class Exception to catch pretty much anything, but is not considered a good practice.
2 of 4
2
Traceback (most recent call last): Every "error you get" - in the sense of an uncaught exception - starts out that way. That's a thing that Python is doing, to tell you how the program got to the code where the error occurred. It's called a traceback because it, literally, traces the execution of the program backward from the error to the ultimate cause. Each step is labelled with the file with the corresponding code (if applicable), and the code itself. In your case, the line profile = graph.get_object("me") was in your code, and because graph was an instance of some class in the facebook package, the next bit of code was in that file. The last thing that happened was a raise statement, indicating that the code explicitly detected an error and chose to report it by raising an exception. To determine the type of exception, you want the last line of the traceback, which is labelled with the exception type - facebook.GraphAPIError. (Notice that they follow the standard convention, by giving it a name that ends in Error.) Note that this is not enough information by itself to decide what to do. You need to think about why the exception is happening, and then decide a) if you can prevent it; b) if your program can meaningfully continue if the error happens anyway; c) what to do if the error happens.
🌐
Real Python
realpython.com › python-traceback
Understanding the Python Traceback – Real Python
July 31, 2023 - The Python documentation defines when this exception is raised: Raised when the import statement has troubles trying to load a module. Also raised when the ‘from list’ in from ... import has a name that cannot be found. (Source) Here’s an example of the ImportError and ModuleNotFoundError being raised: ... >>> import asdf Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'asdf' >>> from collections import asdf Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'asdf'
🌐
Python.org
discuss.python.org › python help
Error "Traceback(most recent call last):" - Python Help - Discussions on Python.org
April 4, 2021 - Hello, I’m trying to make a command prompt thingy. When I try and open it in a preview on PyChamp the code runs fine, but in a regular file it closes, and I was able to see the error Python error Traceback(most recent call last): I know the problem is where I try to import pythonroblox.
Find elsewhere
🌐
Python documentation
docs.python.org › 3 › tutorial › errors.html
8. Errors and Exceptions — Python 3.14.3 documentation
>>> try: ... raise NameError('HiThere') ... except NameError: ... print('An exception flew by!') ... raise ... An exception flew by! Traceback (most recent call last): File "<stdin>", line 2, in <module> raise NameError('HiThere') NameError: HiThere
🌐
Plain English
python.plainenglish.io › deciphering-pythons-traceback-most-recent-call-last-aeea847bb34b
Deciphering Python’s Traceback (most recent call last) | by Py-Core Python Programming | Python in Plain English
March 10, 2025 - It lists each function call that was active at the time of the error, starting with the most recent. By reading it, you can trace back through the code to find where the problem started.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-traceback
Python Traceback - GeeksforGeeks
July 23, 2020 - # Python program to demonstrate # traceback mylist = [1, 2, 3] print(mylist[10]) In this example, we are trying to access the 10th element of the list. With only 3 elements present in the list it will give Runtime error. When this program is executed you will get the following traceback. Traceback (most recent call last): File "", line 2, in print(mylist[10]) IndexError: list index out of range This traceback error has all the information about why this runtime error occurred.
🌐
GitHub
github.com › FoundationAgents › MetaGPT › issues › 130
Error : Traceback (most recent call last): · Issue #130 · FoundationAgents/MetaGPT
August 6, 2023 - File "C:\Users\Willy\Desktop\B...^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Willy\AppData\Roaming\Python\Python311\site-packages\fire\core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Willy\AppData\Roaming\Python\...
Author   RedWilly
🌐
YouTube
youtube.com › watch
Traceback (most recent call last): Python's tracebacks explained
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
🌐
ROS Answers
answers.ros.org › question › 392106
i have a error "Traceback (most recent call last):" could you help me? - ROS Answers archive
Traceback (most recent call last): File "/home/ahmet/catkinws/src/rosserial/rosserialpython/nodes/serialnode.py", line 39, in · from rosserialpython import SerialClient, RosSerialServer File "/home/ahmet/catkinws/devel/lib/python2.7/dist-packages/rosserialpython/init.py", line 34, in
🌐
Uomresearchit
uomresearchit.github.io › python-novice-inflammation › 07-errors
Programming with Python: Errors and Exceptions
January 31, 2019 - --------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-8-9553ee03b645> in <module>() ----> 1 print(hello) NameError: name 'hello' is not defined
🌐
Astrofrog
astrofrog.github.io › py4sci › _static › 17. Understanding Python errors.html
17. Understanding Python errors
By now, you have likely encountered Python errors very often. Here is an example of an error: ... --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-1-07a9845b0745> in <module>() 1 s = 'hello' ----> 2 s[0] = 'a' TypeError: 'str' object does not support item assignment
🌐
Python Forum
python-forum.io › thread-33085.html
AttributeError Traceback (most recent call last)
March 28, 2021 - Hello, I created a class: class inportProp: def __init__(self, t0, tM, incoming, phys, clinkdt, otherport=None, name=''): self.DEBUG=True self.lastt=t0 self.tM=tM if self.tM == 0: def updateqmem(t): p