751 questions
1
vote
2
answers
174
views
ipython gives wrong traceback when error in a .py file
Python 3.12.2,
IPython 9.7.0,
linux debian.
When an error is found in a .py file, the traceback in ipython does not show the right code snippet, making debugging very difficult. This depends on past ...
1
vote
3
answers
117
views
How to get traceback from a module using a decorator?
I have a decorator in the root of a package that should log out information about unexpected exceptions.
from logging import getLogger
from os.path import basename
from traceback import extract_tb
...
0
votes
1
answer
86
views
Jump to single link from Python traceback [closed]
I have a Python file open in Visual Studio Code, and I run the file in the integrated terminal. When it hits a problem in my code (problems? in MY code???!), Python gives me the usual Traceback, ...
0
votes
1
answer
97
views
Traceback error and script can't read csv
I am getting a traceback most recent call last from a iteraction between dakota and python. I need to give a csv file for python and dakota read, but when i start running it shows the the error ...
-1
votes
1
answer
4k
views
error (AttributeError) problem with passlib[bcrypt] module [duplicate]
(trapped) error reading bcrypt version
Traceback (most recent call last):
File "C:\\Users\\User\\Desktop\\lazare\\api practice\\venv\\Lib\\site-packages\\passlib\\handlers\\bcrypt.py", line ...
2
votes
1
answer
127
views
How to print to console a clickable link to project file in python?
I want to print to PyCharm's console clickable links to my project's files with line numbers.
Almost the same thing works when exception stack is printed with traceback.format_exc():
import traceback
...
3
votes
1
answer
568
views
RuntimeError: unauthorized use of script (1:1107) after obfuscating Python script with PyArmor and compiling with Nuitka
I obfuscated my Python script using PyArmor and then compiled it into a binary executable using Nuitka. However, when I try to run the .exe file, I receive the following error:
Traceback (most recent ...
0
votes
0
answers
52
views
How can I get a full traceback from "R CMD check"?
I am writing an R package, and when I run R CMD check, I get an error with an unhelpful incomplete traceback like:
Error in .foreachGlobals$info(.foreachGlobals$data, "workers") :
...
1
vote
1
answer
136
views
How to get full Traceback messages when the 'open' syscall is banned?
I am working on providing an environment for running users' untrusted python code. I use the python bindings of libseccomp library to avoid triggering unsafe system calls, and the service is running ...
0
votes
1
answer
178
views
How do I properly handle exceptions in Python without losing the traceback information?
I'm working on a Python application where I need to gracefully handle exceptions and log useful information for debugging purposes. Specifically, I want to catch exceptions that occur during runtime, ...
2
votes
4
answers
304
views
How to disable the caret (^) characters in the Python stacktrace?
I have a script for doing test readouts that worked fine with Python 3.9 but now we upgraded to Python 3.12 we have those carets that break the script. So the easiest way would be disabling it.
Is ...
4
votes
1
answer
229
views
Improving the R traceback when rendering R Markdown non-interactively
It used to be possible to get an informative traceback when rendering R Markdown non-interactively, where the traceback would only show function calls for code within the R Markdown notebook, as long ...
0
votes
1
answer
676
views
Pytest File Name is giving me Traceback file frozen runpy & boostrap & framework python error ModuleNotFoundError No module named 'Crypto' on MacOS
I'm trying to run tests in python files that have been built on the back of the Cairo programming language. But, when I run python3 -m pytest /test_name.py I get the following traceback error. It ...
1
vote
1
answer
82
views
Except Hook not working correctly with Vscode debugger
I'm trying to make a library for python and I want to add custom exceptions, but every time I raise an exception, the exception shows my raise as the problem.
For example:
Traceback (most recent call ...
0
votes
1
answer
128
views
"Is not terminated with newline" Ren'py
I had launched my programm, but it gave me a traceback that says: "line 9: is not terminated with newline". I don't see a mistake. Can someone explain it to me?
init:
#Название мода
...
2
votes
1
answer
195
views
Why doesn't the "repeated" number go up in the traceback as I increase the recursion limit?
When I run a recursive function and it exceeds the recursion depth limit, the below error is displayed:
Python 3.12.4+ (heads/3.12:99bc8589f0, Jul 27 2024, 11:20:07) [GCC 12.2.0] on linux
Type "...
0
votes
2
answers
68
views
Can't write a loop in Selenium Python
I can't write a loop in selenium python, I'm trying to make a bot that it'll write a descripton of products. The loop was worked successfully for the first product but when comes second product it ...
1
vote
1
answer
60
views
Django Debug=False returns error traceback
I support Django 4.0 project and notice that even though DEBUG=False, all errors return with tracebacks.
I've commented all extras in settings.py, but still receive the traceback.
All variebles are ...
3
votes
1
answer
73
views
Print list (or tree) of active TRY blocks
I am debugging some complicated legacy Python3 code and find myself needing to know, at a particular point in the executing code, all the try blocks that are active in the call stack. Is there a way ...
1
vote
4
answers
2k
views
Is there a way to get the traceback of an async function which was called with asyncio.gather and see which function called it?
The problem can be summarised in this example:
import asyncio
import traceback
async def func_c():
print("func c")
traceback.print_stack()
async def func_b():
print("func ...
0
votes
1
answer
52
views
Logging Exceptions with Custom Traces in Python
I'm working on a Python program where I need to log all exceptions (with custom logger on clickhouse), including their context, to aid in debugging. Instead of simply logging the final function that ...
2
votes
0
answers
27
views
Only show references to my files in a Python exception traceback
When I have an error in a Python script, the traceback output references a number of "core" python files.
Example:
Traceback (most recent call last):
File
~\App\Anaconda3\Lib\site-packages\...
0
votes
0
answers
24
views
After converting a .py file to an .exe file console always closing
import yadisk
import os
from datetime import datetime
y = yadisk.YaDisk(token="TOKEN")
def run(path):
date = datetime.strftime(datetime.now(), "%d.%m.%Y-%H.%M.%S")
y....
1
vote
1
answer
668
views
module 'sys' has no attribute 'last_traceback'
A bit confused by whether this is a standard attribute. The doc string says it does exist.
In [1]: import sys
In [2]: sys.last_traceback
---------------------------------------------------------------...
-1
votes
1
answer
4k
views
"Traceback (most recent call last):" how to remove this error in python? [duplicate]
I am making a voice assistant in Python. I just create its first function but I am having same traceback error again and again. can anyone tell me what mistake I am making here?
this is what i created ...
0
votes
0
answers
60
views
How to use inspect to get the callee's info from caller in Python?
When a method makes a call to several callees within itself, is there a way to use the inspect module to get or log the immediate callees of the called method?
I tried using inspect.getouterframes() ...
0
votes
1
answer
45
views
Who prints the stack information?
when my process double free, I get some print, I wonder those info print by who ?
if I donot need it, can I close the print?
// g++ hel.cpp
#include <iostream>
int main() {
int *p = new int;...
0
votes
1
answer
65
views
Getting concise error message with python subprocess logging and traceback
I am writing an automatic program which I wish to run through errors and gather information. With my current setup I get the following example logging for one loop instance:
2024-03-21 10:14:44,843 - ...
0
votes
2
answers
768
views
NotImplementedError YOLO ultralitycs
When launching neural network training, I get this error:
NotImplementedError Traceback (most recent call last)
Cell In[1], line 5
1 from ultralytics import YOLO
3 ...
0
votes
0
answers
27
views
Jupyter Hub coding issue
having a bit of trouble with some code here and I'm not sure what I'm doing wrong. I created my first plot using a dataframe and wrote the code like this (it accurately produced the plot I needed):
...
2
votes
1
answer
158
views
'print(text_body)' produces unexpected blank output from copied PyPDF User Guide code
Former title: "TypeError: PageObject.extract_text() got an unexpected keyword argument 'visitor_text'"
Trying to follow PyPDF Documentation's example here on using a visitor to extract text.
...
1
vote
1
answer
114
views
Running the same exact trivial code, with a trivial (on purpose) bug, produces the traceback sometimes before a print output and sometimes after
The code in question:
print('s')
y=1/0
In which I understand the error perfectly (it's just division by zero), causes, when ran (while on PyCharm, by pressing shift+f10, the normal way) either the ...
2
votes
0
answers
89
views
How to Traceback C++ in conditions like double free detected or floating point error etc
#include <cstdio>
#include <execinfo.h>
#include <csignal>
#include <cstdlib>
#include <unistd.h>
#include "stacktrace.h"
//// TRACEBACK TEST
void ...
0
votes
1
answer
37
views
How to modify the value of an attribute according to a condition in a JSON file using python
I don't know anything about JSON files and I'm trying to use a loop with an if structure in python to modify some values in it.
I thought it would be an easy task but as I don't know anything about ...
0
votes
1
answer
65
views
yolov5 not working when typing sudo yolov5 detect
enter image description here
File "/usr/local/lib/python3.9/dist-packages/torch/optim/optimizer.py", line 23, in
from typing_extensions import ParamSpec, Self, TypeAlias
ImportError: cannot ...
1
vote
1
answer
225
views
Python extract only exceptions from traceback
I have nested python exceptions. I wan't to extract all of them into a list from a traceback while discarding everything else, i.e. files, code lines, etc.
The code below extracts everything from a ...
0
votes
0
answers
122
views
Discord.py Bot: SSL cetificate not found
I'm a French beginner developer. Recently I've been thinking about making a Discord Bot in Python. So I watched a few videos but no matter how much I copied what they were doing, I kept getting errors ...
1
vote
1
answer
658
views
Unable to Import CoolProp
I am new in programming thing, I just start it yesterday
maybe its very basic
I want to import coolProp to input Cp and Cv value, but when i type:
import CoolProp.CoolProp as CP
it shows following ...
0
votes
0
answers
36
views
What can i do to solve this error in Python with pandas and requests? [duplicate]
Traceback (most recent call last):
File "C:\\Users\\49152\\PycharmProjects\\pythonProject\\main.py", line 4, in \<module\>
import panda as pd
File "C:\\Users\\49152\\...
1
vote
1
answer
180
views
Python: How can I handle an error that came up with numpy.loadtxt? TypeError: argument must be an integer
I am writing Python code that takes in a .csv file and uses the data in it to create graphs. I am using numpy.loadtxt to accomplish this. The beginning of my code is as follows:
import numpy
infile = ...
0
votes
0
answers
69
views
Remove calls from the traceback
I have a small class in geometry.py:
class Pyramid():
def __init__(self, sign, name):
if len(sign.split(".")) != 2:
raise ValueError("pyramid must have 1 apex ...
0
votes
1
answer
383
views
How to get full stack trace from Tkinter Tk.report_callback_exception?
Whenever I get an error in my Tkinter application, I would like to get a full stack trace of where the error occurred, through all of the functions the program is currently in.
Before my root window ...
2
votes
0
answers
116
views
How to remove "raise ValueError()" from the traceback output?
Here is an example:
def f(x):
if x == 0:
raise ValueError("Input is zero")
return
print(f(0))
which results in
Traceback (most recent call last):
File "..\file.py&...
2
votes
1
answer
706
views
Can't run a .py file AttributeError: module 'collections' has no attribute 'MutableSequence'
I have a ubuntu server and am trying to run a website using python w/ flask Running Python 3.11.4
I run the command:
python app.py
Expected behavior: It should execute the without error.
I get the ...
0
votes
0
answers
31
views
Deepface error. ImportError: cannot import name 'formatargspec' from 'inspect' [duplicate]
from deepface import DeepFace
# Provide the correct path to your image file
img_path = "happy_face_woman.png"
# Analyze the face in the image
face_analysis = DeepFace.analyze(img_path=...
0
votes
0
answers
24
views
python+flask:reported error at python console
run a demo code to test the python & flask, the code show as below:enter image description here
the error message is :
enter image description here
check the pycharm si 2022.2.3;
python is 3.10
...
0
votes
1
answer
371
views
How to capture the traceback for an error in python along with source code?
When I run a vscode notebook cell or a python file with these contents:
def foo():
return 4/0 # This will cause a division by zero exception
foo()
I get the following error traceback which is ...
1
vote
0
answers
119
views
How do I get snakemake to give me a full traceback?
I'm attempting to debug a bug I reported on snakemake. The exception being raised is a WorkflowError. It would really be helpful if I could see a full traceback for the exception, but the error ...
0
votes
0
answers
36
views
PyPI: ics - can't generate calender (string = string.replace("\\", "\\\\") AttributeError: 'int' object has no attribute 'replace')
My code is this:
import pandas as pd
import datetime
from ics import Calendar, Event
for i in range(1, 365+1):
c = Calendar()
e = Event()
e.name = i
startdate = pd.Timestamp("08/...
2
votes
0
answers
58
views
Saving python exception to reraise later while keeping traceback
I'm currently writing decorators to cache results on disk. I would like that f(x) gives the same result whether f(x) has already been stored or not, even when f(x) raises an exception. i.e loading the ...