-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Pylint displays E0001 error code while importing packages. Code functions. #3270
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
Comments
Can you post the exact file that triggers this exception as well as the output? There must be something amiss especially since |
https://github.com/Fernal73/LearnPython3/blob/master/Intermediate/generator.py
This is one of the files that produces the error message.
I've currently suppressed the errors by updating .pylintrc and
.prospector.yaml.
It throws up E0001 in red at the import statements.
If you still can't reproduce the problem, I'll revert the suppressions and
post the results.
The programs run. It appears to be a problem in one of underlying packages bubbled up.
<code>
[7;33m************* Module namedtuple[0m
Newbies/namedtuple.py:3:0: E0001: [1;31mCannot import 'collections' due to syntax error 'invalid syntax (<unknown>, line 96)'[0m ([1;31msyntax-error[0m)
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/astroid/__init__.py", line 91, in _inference_tip_cached
return iter(_cache[func, node])
KeyError: (<function infer_named_tuple at 0x7f7ff45280>, <Call l.5 at 0x7f7facea60>)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/bin/pylint", line 10, in <module>
sys.exit(run_pylint())
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/__init__.py", line 20, in run_pylint
Run(sys.argv[1:])
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/lint.py", line 1628, in __init__
linter.check(args)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/lint.py", line 943, in check
self._do_check(files_or_modules)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/lint.py", line 1075, in _do_check
self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/lint.py", line 1158, in check_astroid_module
walker.walk(ast_node)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/utils.py", line 1303, in walk
self.walk(child)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/utils.py", line 1303, in walk
self.walk(child)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/utils.py", line 1300, in walk
cb(astroid)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/checkers/base.py", line 1747, in visit_assignname
if isinstance(utils.safe_infer(assign_type.value), astroid.ClassDef):
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/pylint/checkers/utils.py", line 1065, in safe_infer
inferit = node.infer(context=context)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/astroid/node_classes.py", line 348, in infer
return self._explicit_inference(self, context, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/astroid/__init__.py", line 93, in _inference_tip_cached
result = func(*args, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/astroid/brain/brain_namedtuple_enum.py", line 173, in infer_named_tuple
rename = next(call_site.infer_argument(func, "rename", context)).bool_value()
File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/astroid/arguments.py", line 160, in infer_argument
if len(self.positional_arguments) > len(funcnode.args.args):
TypeError: object of type 'Uninferable' has no len()
</code>
https://github.com/Fernal73/LearnPython3/blob/master/Newbies/namedtuple.py
Above error message for namedtuple.py.
|
Updated with error.
|
termux/termux-packages#4612 (comment) Closing bug. Fixed via Termux support. |
On installing prospector via pip , I was able to reproduce the error importing the modules once more. I receive the following error when installing pylint after installing prospector: ERROR: prospector 1.1.7 has requirement astroid==2.2.5, but you'll have astroid 2.3.3 which is incompatible. I then have DistributionNotFound errors while running prospector. |
Do I need to open a separate bug on Prospector or will you do the needful? |
Sorry I'm not entirely sure how to reproduce this error, so feel free to report a bug on Propsector side as well. |
I can't find any pre-existing issues on Prospector. I think a link to this
bug should suffice as a bug report. I'm not inclined to re-describe the
issue. There's a limit to bureaucratese I can stand---from anyone.
|
pip install prospector==1.2.0.dev3 |
Arch Linux on Termux:
$ pylint --version
pylint 2.3.1
astroid 2.2.5
Python 3.8.0 (default, Nov 14 2019, 15:41:40)
[GCC 8.3.0]
Termux:
$ pylint --version
pylint 2.3.1
astroid 2.2.5
Python 3.8.0 (default, Nov 20 2019, 20:44:46)
[Clang 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf6
import random
throws an error with code E0001 when used in python source.
(Should this be a pylint issue or should I post it on the Github projects for Termux and/or ArchLinux for Termux?)
#2976 (comment)
The text was updated successfully, but these errors were encountered: