installation of pylint3 failed under ubuntu xenial

Asked by Shao-Chieh Chiang on 2019-12-04

under some circumstances after installing pylint3 i can't even run pylint3 from command line:
 00:21:30 Traceback (most recent call last):
00:21:30 File "/usr/bin/pylint3", line 3, in <module>
00:21:30 run_pylint()
00:21:30 File "/usr/lib/python3/dist-packages/pylint/__init__.py", line 23, in run_pylint
00:21:30 Run(sys.argv[1:])
00:21:30 File "/usr/lib/python3/dist-packages/pylint/lint.py", line 1275, in __init__
00:21:30 'init-hook')))
00:21:30 File "/usr/lib/python3/dist-packages/pylint/lint.py", line 1376, in cb_init_hook
00:21:30 exec(value) # pylint: disable=exec-used
00:21:30 File "<string>", line 1, in <module>
00:21:30 ImportError: No module named 'app'

but under other circumstances it works as expected. could it be some side effects of pkg incompatibility? certain pip/apt pkg that's conflicting it? just wild guess. did anyone encounter this before?
i got python3.5.2 and python2.7.12
i tried installing astroid 1.4.4 and 2.3.3 both of no avail.
the only thing i could try is to compare installed pkgs between working/non-working envs.

Thanks,
Don

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu pylint Edit question
Assignee:
No assignee Edit question
Last query:
2019-12-04
Last reply:
2019-12-05
Manfred Hampl (m-hampl) said : #1

From where did you install pylint3?
It seems to me that you do not have the version provided in the Ubuntu repositories for xenial, but a version from elsewhere.

"i tried installing astroid 1.4.4 and 2.3.3 both of no avail.":
What happens if you try installing astroid 1.4.4 from the Ubuntu repositories (sudo apt install python-astroid python3-astroid)?

it's a ubuntu 16.04 container actually.
the pylint3 version i installed is 1.5.2-1ubuntu1. do i need another ppa?
i installed astroid 1.4.4 like you told me and it was still failing.
then i exited the container and re-enter the container then it works all of a suddenit (pylint3 --version).
but it's not reflecting the right versions i installed (pylint3 1.5.2 and astroid 1.4.4).
instead it's showing pylint 2.4.4 and astroid 2.3.3, however, i already removed pip installed pylint and astroid.
i would like it to be set up and work as expected as this is ci env setup so i can't exit the container and reenter...
i heard travis ci has different working pkg for pylint3?

sorry i forgot to remove pip3 installed pylint and astroid lemme try again... so those versions were showing.
removed them and it's showing pylint3 1.5.2 and astroid 1.4.4 fine.
but installing pylint3 in the container and running it for the first time would still fail...

Manfred Hampl (m-hampl) said : #4

We can only help with the packages in the standard Ubuntu repositories.
If you install software from other sources (e.g. with pip or from PPAs), then this is in your own responsibility, and we cannot provide support.

"installing pylint3 in the container and running it for the first time would still fail..."
Installing from which source, and with which command?
"Fail" in which sense? Are there error messages?

yes i installed it from Ubuntu repo:
apt update
apt install pylint3

and that's it. i did not specify other dependencies or the like. but the setup is not just installing pylint3 alone. it's among a list of pkgs and other setup.

failing means simply run "pylint3 --version" after installation and got the aforementioned import error. we need to run pylint3 as part of test step.

Manfred Hampl (m-hampl) said : #6

The aforementioned import error cannot be caused by the Ubuntu-provided pylint3 package, because Ubuntu's "/usr/lib/python3/dist-packages/pylint/lint.py" file doesn't have a line 1376 (only 1369 lines in total).

I suggest that you remove all foreign pylint files and try again with only Ubuntu-provided packages.

after spinning up some fresh container off ubuntu:16.04 image, installing just pylint3 would work as expected.

our container is built upon pre-built ubuntu image and provisioned with some complex setup. i managed to repeat the same process locally. pylint3 also works fine.

the only difference is that this failing setup is inside some CI environment. we user screwdriver here. i might have to take it up with SD devel.

Can you help with this problem?

Provide an answer of your own, or ask Shao-Chieh Chiang for more information if necessary.

To post a message you must log in.