Access dataframe with multi-level index on pandas v1.0.3 - pandas

I'm trying to access a row of the dataframe dtSortedTable by
dtSortedTable.loc[decisionCountSorted.index[0]]
dtSortedTable is
X0 X1 X2
(D1, G2) A B C
(D2, G1) A A A
(D2, G0) A A C
decisionCountSorted indexes look like:
Index([('D1', 'G2'), ('D2', 'G1'), ('D2', 'G0')], dtype='object')
The indexes of decisionCountSorted are exactly the same as dtSortedTable. The indexes are multilevel with 2 levels. Why am I getting the below error? I need to run some tests on decisionCountSorted and extract the corresponding rows from dtSortedTable. Any help would be hugely appreciated!
Traceback (most recent call last):
File "/usr/local/Caskroom/miniconda/base/envs/logicsim/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2646, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'D1'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/tkazi/Documents/Code/logicsim/logic.py", line 183, in <module>
dtFixed = dtConsensus(dtSortedTable,quorumCount)
File "/Users/tkazi/Documents/Code/logicsim/logic.py", line 119, in dtConsensus
print(dtSortedTable.loc[decisionCountSorted.index[0]])
File "/usr/local/Caskroom/miniconda/base/envs/logicsim/lib/python3.8/site-packages/pandas/core/indexing.py", line 1762, in __getitem__
return self._getitem_tuple(key)
File "/usr/local/Caskroom/miniconda/base/envs/logicsim/lib/python3.8/site-packages/pandas/core/indexing.py", line 1272, in _getitem_tuple
return self._getitem_lowerdim(tup)
File "/usr/local/Caskroom/miniconda/base/envs/logicsim/lib/python3.8/site-packages/pandas/core/indexing.py", line 1389, in _getitem_lowerdim
section = self._getitem_axis(key, axis=i)
File "/usr/local/Caskroom/miniconda/base/envs/logicsim/lib/python3.8/site-packages/pandas/core/indexing.py", line 1965, in _getitem_axis
return self._get_label(key, axis=axis)
File "/usr/local/Caskroom/miniconda/base/envs/logicsim/lib/python3.8/site-packages/pandas/core/indexing.py", line 625, in _get_label
return self.obj._xs(label, axis=axis)
File "/usr/local/Caskroom/miniconda/base/envs/logicsim/lib/python3.8/site-packages/pandas/core/generic.py", line 3537, in xs
loc = self.index.get_loc(key)
File "/usr/local/Caskroom/miniconda/base/envs/logicsim/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'D1'

Related

I'm trying to import CSV file using pandas, But I'm getting Error

C:\Users\Misti\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/Misti/PycharmProjects/pythonProject/main.py
Traceback (most recent call last):
File "C:/Users/Misti/PycharmProjects/pythonProject/main.py", line 2, in <module>
df = pd.read_csv('milestone2.csv')
File "C:\Users\Misti\PycharmProjects\pythonProject\venv\lib\site-packages\pandas\util\_decorators.py", line 311, in wrapper
return func(*args, **kwargs)
File "C:\Users\Misti\PycharmProjects\pythonProject\venv\lib\site-packages\pandas\io\parsers\readers.py", line 586, in read_csv
return _read(filepath_or_buffer, kwds)
File "C:\Users\Misti\PycharmProjects\pythonProject\venv\lib\site-packages\pandas\io\parsers\readers.py", line 482, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "C:\Users\Misti\PycharmProjects\pythonProject\venv\lib\site-packages\pandas\io\parsers\readers.py", line 811, in __init__
self._engine = self._make_engine(self.engine)
File "C:\Users\Misti\PycharmProjects\pythonProject\venv\lib\site-packages\pandas\io\parsers\readers.py", line 1040, in _make_engine
return mapping[engine](self.f, **self.options) # type: ignore[call-arg]
File "C:\Users\Misti\PycharmProjects\pythonProject\venv\lib\site-packages\pandas\io\parsers\c_parser_wrapper.py", line 69, in __init__
self._reader = parsers.TextReader(self.handles.handle, **kwds)
File "pandas\_libs\parsers.pyx", line 549, in pandas._libs.parsers.TextReader.__cinit__
pandas.errors.EmptyDataError: No columns to parse from file
Process finished with exit code 1

Tensorboard not working with after upgrading tensorflow from 2.1.2 to 2.3.0

I was using TensorFlow 2.1.2 and TensorBoard 2.4.1,
import os, shutil
import tensorflow as tf
print(tf.__version__)
SUMMARY_DIR = 'summary/testing_this'
if 1:
# SUMMARY_DIR is the path of the directory where the tensorboard SummaryWriter files are written
# the directory is removed, if it already exists
if os.path.exists(SUMMARY_DIR):
shutil.rmtree(SUMMARY_DIR)
train_summary_writer = tf.summary.create_file_writer(os.path.join(SUMMARY_DIR, 'train'))
test_summary_writer = tf.summary.create_file_writer(os.path.join(SUMMARY_DIR, 'test'))
train_summary_counter = 0
for i in range(100):
with train_summary_writer.as_default():
tf.summary.scalar('train/sampled-softmax loss', i+5, step=train_summary_counter)
train_summary_counter += 1
The code written above worked perfectly fine. But as I upgraded to TensorFlow 2.3.0, the following error was thrown-
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.4.1 at http://localhost:6006/ (Press CTRL+C to quit)
E0216 07:39:53.581997 140588167055104 _internal.py:113] Error on request:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 124, in read_chunk_len
_len = int(line.strip(), 16)
ValueError: invalid literal for int() with base 16: '------WebKitFormBoundary20rNOiiimzABSId3'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 131, in wrapper
return f(self, stream, *args, **kwargs)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 253, in _parse_multipart
form, files = parser.parse(stream, boundary, content_length)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 584, in parse
return self.cls(form), self.cls(files)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/datastructures.py", line 419, in __init__
for key, value in mapping or ():
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 582, in <genexpr>
form = (p[1] for p in formstream if p[0] == "form")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 537, in parse_parts
for ellt, ell in self.parse_lines(file, boundary, content_length):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 451, in parse_lines
terminator = self._find_terminator(iterator)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 368, in _find_terminator
for line in iterator:
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wsgi.py", line 721, in make_line_iter
first_item = next(_iter, "")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wsgi.py", line 681, in _make_chunk_iter
item = _read(buffer_size)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 137, in readinto
self._len = self.read_chunk_len()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 126, in read_chunk_len
raise IOError("Invalid chunk header")
OSError: Invalid chunk header
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 124, in read_chunk_len
_len = int(line.strip(), 16)
ValueError: invalid literal for int() with base 16: 'Content-Disposition: form-data; name="tag"'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 323, in run_wsgi
execute(self.server.app)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 312, in execute
application_iter = app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 526, in __call__
return self._app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 567, in wrapper
return wsgi_app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/security_validator.py", line 80, in __call__
return self._application(environ, start_response_proxy)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/path_prefix.py", line 71, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/experiment_id.py", line 76, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/empty_path_redirect.py", line 47, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 590, in wrapper
return wsgi_app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 549, in _route_request
return self.exact_routes[clean_path](environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 238, in application
resp = f(*args[:-2] + (request,))
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/plugins/scalar/scalars_plugin.py", line 166, in scalars_multirun_route
tags = request.form.getlist("tag")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/utils.py", line 90, in __get__
value = self.func(obj)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 480, in form
self._load_form_data()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 319, in _load_form_data
self._get_stream_for_parsing(), mimetype, content_length, options
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 232, in parse
return parse_func(self, stream, mimetype, content_length, options)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 138, in wrapper
chunk = stream.read(1024 * 64)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 137, in readinto
self._len = self.read_chunk_len()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 126, in read_chunk_len
raise IOError("Invalid chunk header")
OSError: Invalid chunk header
E0216 07:39:53.585781 140588158662400 _internal.py:113] Error on request:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 124, in read_chunk_len
_len = int(line.strip(), 16)
ValueError: invalid literal for int() with base 16: '------WebKitFormBoundary4NW6Hm666U0prn4r'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 131, in wrapper
return f(self, stream, *args, **kwargs)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 253, in _parse_multipart
form, files = parser.parse(stream, boundary, content_length)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 584, in parse
return self.cls(form), self.cls(files)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/datastructures.py", line 419, in __init__
for key, value in mapping or ():
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 582, in <genexpr>
form = (p[1] for p in formstream if p[0] == "form")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 537, in parse_parts
for ellt, ell in self.parse_lines(file, boundary, content_length):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 451, in parse_lines
terminator = self._find_terminator(iterator)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 368, in _find_terminator
for line in iterator:
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wsgi.py", line 721, in make_line_iter
first_item = next(_iter, "")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wsgi.py", line 681, in _make_chunk_iter
item = _read(buffer_size)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 137, in readinto
self._len = self.read_chunk_len()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 126, in read_chunk_len
raise IOError("Invalid chunk header")
OSError: Invalid chunk header
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 124, in read_chunk_len
_len = int(line.strip(), 16)
ValueError: invalid literal for int() with base 16: 'Content-Disposition: form-data; name="tag"'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 323, in run_wsgi
execute(self.server.app)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 312, in execute
application_iter = app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 526, in __call__
return self._app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 567, in wrapper
return wsgi_app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/security_validator.py", line 80, in __call__
return self._application(environ, start_response_proxy)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/path_prefix.py", line 71, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/experiment_id.py", line 76, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/empty_path_redirect.py", line 47, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 590, in wrapper
return wsgi_app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 549, in _route_request
return self.exact_routes[clean_path](environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 238, in application
resp = f(*args[:-2] + (request,))
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/plugins/scalar/scalars_plugin.py", line 166, in scalars_multirun_route
tags = request.form.getlist("tag")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/utils.py", line 90, in __get__
value = self.func(obj)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 480, in form
self._load_form_data()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 319, in _load_form_data
self._get_stream_for_parsing(), mimetype, content_length, options
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 232, in parse
return parse_func(self, stream, mimetype, content_length, options)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 138, in wrapper
chunk = stream.read(1024 * 64)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 137, in readinto
self._len = self.read_chunk_len()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 126, in read_chunk_len
raise IOError("Invalid chunk header")
OSError: Invalid chunk header
E0216 07:39:53.721650 140588158662400 _internal.py:113] Error on request:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 124, in read_chunk_len
_len = int(line.strip(), 16)
ValueError: invalid literal for int() with base 16: '------WebKitFormBoundaryQo6LrfWENvCGlGD7'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 131, in wrapper
return f(self, stream, *args, **kwargs)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 253, in _parse_multipart
form, files = parser.parse(stream, boundary, content_length)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 584, in parse
return self.cls(form), self.cls(files)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/datastructures.py", line 419, in __init__
for key, value in mapping or ():
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 582, in <genexpr>
form = (p[1] for p in formstream if p[0] == "form")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 537, in parse_parts
for ellt, ell in self.parse_lines(file, boundary, content_length):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 451, in parse_lines
terminator = self._find_terminator(iterator)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 368, in _find_terminator
for line in iterator:
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wsgi.py", line 721, in make_line_iter
first_item = next(_iter, "")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wsgi.py", line 681, in _make_chunk_iter
item = _read(buffer_size)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 137, in readinto
self._len = self.read_chunk_len()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 126, in read_chunk_len
raise IOError("Invalid chunk header")
OSError: Invalid chunk header
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 124, in read_chunk_len
_len = int(line.strip(), 16)
ValueError: invalid literal for int() with base 16: 'Content-Disposition: form-data; name="tag"'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 323, in run_wsgi
execute(self.server.app)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 312, in execute
application_iter = app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 526, in __call__
return self._app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 567, in wrapper
return wsgi_app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/security_validator.py", line 80, in __call__
return self._application(environ, start_response_proxy)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/path_prefix.py", line 71, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/experiment_id.py", line 76, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/empty_path_redirect.py", line 47, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 590, in wrapper
return wsgi_app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 549, in _route_request
return self.exact_routes[clean_path](environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 238, in application
resp = f(*args[:-2] + (request,))
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/plugins/scalar/scalars_plugin.py", line 166, in scalars_multirun_route
tags = request.form.getlist("tag")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/utils.py", line 90, in __get__
value = self.func(obj)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 480, in form
self._load_form_data()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 319, in _load_form_data
self._get_stream_for_parsing(), mimetype, content_length, options
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 232, in parse
return parse_func(self, stream, mimetype, content_length, options)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 138, in wrapper
chunk = stream.read(1024 * 64)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 137, in readinto
self._len = self.read_chunk_len()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 126, in read_chunk_len
raise IOError("Invalid chunk header")
OSError: Invalid chunk header
E0216 07:39:53.824328 140588158662400 _internal.py:113] Error on request:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 124, in read_chunk_len
_len = int(line.strip(), 16)
ValueError: invalid literal for int() with base 16: '------WebKitFormBoundaryPDuqOCLNbMBFkkSo'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 131, in wrapper
return f(self, stream, *args, **kwargs)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 253, in _parse_multipart
form, files = parser.parse(stream, boundary, content_length)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 584, in parse
return self.cls(form), self.cls(files)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/datastructures.py", line 419, in __init__
for key, value in mapping or ():
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 582, in <genexpr>
form = (p[1] for p in formstream if p[0] == "form")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 537, in parse_parts
for ellt, ell in self.parse_lines(file, boundary, content_length):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 451, in parse_lines
terminator = self._find_terminator(iterator)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 368, in _find_terminator
for line in iterator:
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wsgi.py", line 721, in make_line_iter
first_item = next(_iter, "")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wsgi.py", line 681, in _make_chunk_iter
item = _read(buffer_size)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 137, in readinto
self._len = self.read_chunk_len()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 126, in read_chunk_len
raise IOError("Invalid chunk header")
OSError: Invalid chunk header
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 124, in read_chunk_len
_len = int(line.strip(), 16)
ValueError: invalid literal for int() with base 16: 'Content-Disposition: form-data; name="tag"'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 323, in run_wsgi
execute(self.server.app)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 312, in execute
application_iter = app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 526, in __call__
return self._app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 567, in wrapper
return wsgi_app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/security_validator.py", line 80, in __call__
return self._application(environ, start_response_proxy)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/path_prefix.py", line 71, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/experiment_id.py", line 76, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/empty_path_redirect.py", line 47, in __call__
return self._application(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 590, in wrapper
return wsgi_app(environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/backend/application.py", line 549, in _route_request
return self.exact_routes[clean_path](environ, start_response)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 238, in application
resp = f(*args[:-2] + (request,))
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorboard/plugins/scalar/scalars_plugin.py", line 166, in scalars_multirun_route
tags = request.form.getlist("tag")
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/utils.py", line 90, in __get__
value = self.func(obj)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 480, in form
self._load_form_data()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/wrappers/base_request.py", line 319, in _load_form_data
self._get_stream_for_parsing(), mimetype, content_length, options
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 232, in parse
return parse_func(self, stream, mimetype, content_length, options)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/formparser.py", line 138, in wrapper
chunk = stream.read(1024 * 64)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 137, in readinto
self._len = self.read_chunk_len()
File "/home/ec2-user/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/werkzeug/serving.py", line 126, in read_chunk_len
raise IOError("Invalid chunk header")
OSError: Invalid chunk header
Can somebody please help me run tensorboard with tf 2.3.0?
Downgrading with pip install 'tensorboard<2.4' fixed this for me.
It seems tensorboard 2.4 made some breaking change.

Not able to extract a column name using Panda data frame

KeyError: 'Name'
>>> df=pd.read_csv(text_file)
>>> print(df)
Name Age
0 Ritesh 32
1 Priyanka 29
>>> print(df['Name'].where(df['Name'] == 'Ritesh'))
Traceback (most recent call last):
File "/Users/reyansh/venv/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2646, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Name'
During handling of the above exception, another exception occurred:
read_csv didn't read your file into two columns because you have a space as the separator and the default is a comma. Specify the space:
df = pd.read_csv(text_file, " ")

Odoo 11 - Server Error (KeyError) when loading the sales page (Sales Management)

I have installed "Sales Management" app on my Odoo v11 community edition. Everything was working fine until a few days ago. Now whenever I click on the "sales" tab, I get this server error:
Error:
Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 84, in lookup
r = d[key]
File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 68, in wrapper
return func(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 44, in __getitem__
a = self.d[obj].me
KeyError: ('ir.actions.actions', <function IrActions.get_bindings at 0x7efe15cfc0d0>, frozenset({1, 3, 4, 38, 39, 8, 7, 12, 13, 14, 47, 48, 22, 23, 25, 30}), 'sale.order')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 940, in __get__
value = record.env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 967, in get
value = self._data[key][field][record._ids[0]]
KeyError: 291
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 651, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/usr/lib/python3/dist-packages/odoo/http.py", line 693, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 342, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 335, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 937, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 934, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 926, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 687, in call_kw
return call_kw_model(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 672, in call_kw_model
result = method(recs, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 1297, in load_views
for [v_id, v_type] in views
File "/usr/lib/python3/dist-packages/odoo/models.py", line 1297, in <dictcomp>
for [v_id, v_type] in views
File "/usr/lib/python3/dist-packages/odoo/addons/mail/models/mail_thread.py", line 374, in fields_view_get
res = super(MailThread, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 1389, in fields_view_get
bindings = self.env['ir.actions.actions'].get_bindings(self._name)
File "<decorator-gen-27>", line 2, in get_bindings
File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 89, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_actions.py", line 120, in get_bindings
result[binding_type].append(action.read()[0])
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_actions.py", line 207, in read
result = super(IrActionsActWindow, self).read(fields, load=load)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 2609, in read
vals[name] = convert(record[name], record, use_name_get)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 4786, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 944, in __get__
self.determine_value(record)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1055, in determine_value
self.compute_value(recs)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1011, in compute_value
self._compute_value(records)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1002, in _compute_value
getattr(records, self.compute)()
File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_actions.py", line 167, in _compute_search_view
fvg = self.env[act.res_model].fields_view_get(act.search_view_id.id, 'search')
File "/usr/lib/python3/dist-packages/odoo/api.py", line 761, in __getitem__
return self.registry[model_name]._browse((), self)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 179, in __getitem__
return self.models[model_name]
KeyError: 'sale.advance.payment.inv'
The only code change I made was adding an if-else statement in product_template to add a constraint and it was working perfectly fine along with the sales module, but now all of a sudden the sales module throws this exception.
What could be causing this?
Check your manifest.py for dependencies. If you are using a field from another module you must add it.

in __getitem__ return self.models[model_name] KeyError: 'mham_app.mham_app' - - -

try to extend timesheet by adding some fields and change name of other but when i inherited the related model which is 'account.analytic.line':
and add the 'analytic ' module in the manifest as depends
from odoo import models, fields, api
class mham_app(models.Model):
_inherit='account.analytic.line'
date_deadline = fields.Date('Deadline')
is_done = fields.Boolean('Done?')
active = fields.Boolean('Active?', default=True)
the follow is the manifest.py file
# any module necessary for this one to work correctly
'depends': ['analytic'],
the following is full error massage
2019-02-05 20:21:54,528 17339 ERROR New_todo odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/modules/registry.py", line 60, in __new__
return cls.registries[db_name]
File "/odoo/odoo-server/odoo/tools/func.py", line 69, in wrapper
return func(self, *args, **kwargs)
File "/odoo/odoo-server/odoo/tools/lru.py", line 44, in __getitem__
a = self.d[obj].me
KeyError: 'New_todo'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 455, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1624, in _process_end
record.unlink()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 637, in unlink
self._prepare_update()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 584, in _prepare_update
model = self.env[rec.model]
File "/odoo/odoo-server/odoo/api.py", line 820, in __getitem__
return self.registry[model_name]._browse((), self)
File "/odoo/odoo-server/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
KeyError: 'mham_app.mham_app'
2019-02-05 20:21:54,532 17339 INFO New_todo werkzeug: 127.0.0.1 - - [05/Feb/2019 20:21:54] "POST /longpolling/poll HTTP/1.1" 500 - 421 0.353 1.094
2019-02-05 20:21:54,541 17339 ERROR New_todo werkzeug: Error on request:
Traceback (most recent call last):
File "/home/msafi/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 270, in run_wsgi
execute(self.server.app)
File "/home/msafi/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 258, in execute
application_iter = app(environ, start_response)
File "/odoo/odoo-server/odoo/service/server.py", line 350, in app
return self.app(e, s)
File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 128, in application
return application_unproxied(environ, start_response)
File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 117, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1318, in __call__
return self.dispatch(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1291, in __call__
return self.app(environ, start_wrapped)
File "/home/msafi/.local/lib/python3.6/site-packages/werkzeug/wsgi.py", line 766, in __call__
return self.app(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1469, in dispatch
odoo.registry(db).check_signaling()
File "/odoo/odoo-server/odoo/__init__.py", line 81, in registry
return modules.registry.Registry(database_name)
File "/odoo/odoo-server/odoo/modules/registry.py", line 62, in __new__
return cls.new(db_name)
File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 455, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1624, in _process_end
record.unlink()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 637, in unlink
self._prepare_update()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 584, in _prepare_update
model = self.env[rec.model]
File "/odoo/odoo-server/odoo/api.py", line 820, in __getitem__
return self.registry[model_name]._browse((), self)
File "/odoo/odoo-server/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
KeyError: 'mham_app.mham_app' - - -
although of there is no model name mham_app.mham_app
And the error occure also comes if I change the name to something else