Linked Questions
76 questions linked to/from How to disable Python warnings?
20
votes
2
answers
101k
views
How do I block python RuntimeWarning from printing to the terminal? [duplicate]
I have some python code that, at some point, takes the axis means of a reasonably sparse array with nans in. Every time I run the code it raises a RuntimeWarning.
I know what's causing the warning, ...
2
votes
1
answer
8k
views
Suppress output selectively python [duplicate]
How would I be able to selectively output certain python functions and not output others?
Code:
#!/usr/bin/env python
import os
import sys
import pprint
sys.path.append(os.path.join(os.path....
0
votes
0
answers
2k
views
Python reading CSV datetime warning [duplicate]
I am receiving the following warning:
UserWarning: Parsing dates in DD/MM/YYYY format when dayfirst=False (the default) was specified. This may lead to inconsistently parsed dates! Specify a format to ...
0
votes
2
answers
265
views
Issue with shell command used to wrap noisy python script and remove specific lines with sed [duplicate]
I am using a python script that outputs many warnings/errors (going to stderr) based on perfectly normal bad test certificates. Based on several SO posts, I was able find a way to run the script and ...
1
vote
0
answers
244
views
How can I silence RuntimeWarning on iteration speed when using Jupyter notebook with Python3 [duplicate]
The new version of wallstreet package seems to create warning below on each option method. That said, using it on Jupyter Notebook I see no performance or logical calculation errors.
How can I ...
0
votes
0
answers
30
views
Function returning either 0 or -inf without warning [duplicate]
I am trying to write a function that takes the log of a boolean expression np.log(bool_variable). Basically I want the function to return 0 if bool_variable=True or -np.inf if bool_variable=False. One ...
598
votes
16
answers
978k
views
Suppress InsecureRequestWarning: Unverified HTTPS request is being made in Python2.6
I am writing scripts in Python2.6 with use of pyVmomi and while using one of the connection methods:
service_instance = connect.SmartConnect(host=args.ip,
user=...
280
votes
18
answers
415k
views
How to ignore deprecation warnings in Python
I keep getting this :
DeprecationWarning: integer argument expected, got float
How do I make this message go away? Is there a way to avoid warnings in Python?
99
votes
4
answers
77k
views
How to get rid of specific warning messages in python while keeping all other warnings as normal?
I am doing some simple math recursively in a python script and am getting the following warning:
"Warning: divide by zero encountered in divide".
To provide some context, I am taking two ...
79
votes
4
answers
117k
views
How to get rid of BeautifulSoup user warning?
After I installed BeautifulSoup, whenever I run my Python in from the command line, this warning comes out:
D:\Application\python\lib\site-packages\beautifulsoup4-4.4.1-py3.4.egg\bs4\__init__.py:166:
...
87
votes
2
answers
78k
views
Ignore divide by 0 warning in NumPy
I have a function for statistic issues:
import numpy as np
from scipy.special import gamma as Gamma
def Foo(xdata):
...
return x1 * (
( #R is a numpy vector
...
88
votes
3
answers
45k
views
Can I get PyCharm to suppress a particular warning on a single line?
PyCharm provides some helpful warnings on code style, conventions and logical gotchas. It also provides a notification if I try to commit code with warnings (or errors).
Sometimes I consciously ...
14
votes
2
answers
16k
views
deprecation error in sklearn about empty array without any empty array in my code
I am just playing around encoding and decoding but I get this error from sklearn:
Warning (from warnings module):
File "C:\Python36\lib\site-packages\sklearn\preprocessing\label.py", line 151
...
13
votes
5
answers
44k
views
Python 2.7 Openpyxl UserWarning
Why do I receive this warning message every time I run my code? (below). Is it possible to get rid of it? If so, how do I do that?
My code:
from openpyxl import load_workbook
from openpyxl import ...
15
votes
4
answers
12k
views
PDFminer: PDFTextExtractionNotAllowed Error [duplicate]
I'm trying to extract text from pdfs I've scraped off the internet, but when I attempt to download them I get the error:
File "/usr/local/lib/python2.7/dist-packages/pdfminer/pdfpage.py", line 124, ...