-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: list index out of range #1
Comments
here is the issue when the same code is ran in Jupyter Notebook: `--------------------------------------------------------------------------- C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in _to_bytes(self, obj, context) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in _file_should_be_hashed(self, filename) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in _get_main_script_directory() AttributeError: module 'main' has no attribute 'file' During handling of the above exception, another exception occurred: InternalHashError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\caching.py in cache(func, persist, allow_output_mutation, show_spinner, suppress_st_warning, hash_funcs, max_entries, ttl) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in update_hash(val, hasher, hash_reason, hash_source, context, hash_funcs) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in update(self, hasher, obj, context) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in to_bytes(self, obj, context) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in _to_bytes(self, obj, context) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in update(self, hasher, obj, context) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in to_bytes(self, obj, context) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in to_bytes(self, obj, context) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in _to_bytes(self, obj, context) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in _file_should_be_hashed(self, filename) C:\ProgramData\Anaconda3\lib\site-packages\streamlit\hashing.py in _get_main_script_directory() InternalHashError: module 'main' has no attribute 'file' While caching the body of In this specific case, it's very likely you found a Streamlit bug so please In the meantime, you can try bypassing this error by registering a custom
If you don't know where the object of type
Please see the ` |
Above mentioned errors are due to data being old and not available on the hyperlink provided in the code. |
Hi Shail,
I tried to follow your review on Medium, when I run your code on my machine I got the above error:
here is the full error, and the error is not due to reading from the web address, as that function reads the csv:
I am not sure what more I should provide as this is the first time ever I am raising an issue.
`Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users/aedal/OneDrive/Desktop/del.py', wdir='C:/Users/aedal/OneDrive/Desktop')
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/aedal/OneDrive/Desktop/del.py", line 53, in
top_host_1 = df.query('[email protected][0]')
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py", line 3184, in query
res = self.eval(expr, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py", line 3300, in eval
return _eval(expr, inplace=inplace, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\eval.py", line 322, in eval
parsed_expr = Expr(expr, engine=engine, parser=parser, env=env, truediv=truediv)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 827, in init
self.terms = self.parse()
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 844, in parse
return self._visitor.visit(self.expr)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 441, in visit
return visitor(node, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 447, in visit_Module
return self.visit(expr, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 441, in visit
return visitor(node, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 450, in visit_Expr
return self.visit(node.value, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 441, in visit
return visitor(node, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 744, in visit_Compare
return self.visit(binop)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 441, in visit
return visitor(node, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 563, in visit_BinOp
op, op_class, left, right = self._maybe_transform_eq_ne(node)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 484, in _maybe_transform_eq_ne
right = self.visit(node.right, side="right")
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 441, in visit
return visitor(node, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\expr.py", line 603, in visit_Subscript
slobj, local_dict=self.env, engine=self.engine, parser=self.parser
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\eval.py", line 319, in eval
target=target,
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\scope.py", line 31, in _ensure_scope
target=target,
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\scope.py", line 124, in init
self.update(local_dict.level)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\computation\scope.py", line 261, in update
stack = inspect.stack()
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1513, in stack
return getouterframes(sys._getframe(1), context)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1490, in getouterframes
frameinfo = (frame,) + getframeinfo(frame, context)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1464, in getframeinfo
lines, lnum = findsource(frame)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 828, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range`
Thanks,
Amin
The text was updated successfully, but these errors were encountered: