I can't report bug with abrt anymore

When I tried to report a bug from abrt the procedure failed with the python3 error :

ModuleNotFoundError: No module named ‘urllib3.packages.six.moves’

from command

/usr/bin/python3 /usr/bin/reporter-bugzilla -h <id> -p Fedora

even if the package python-urllib3 and python3-six are installed on system.

It was working some time ago.
What can I do to understand the origin of the problem and correct it?
Thank you

The version installed on my kde plasma does not seem to use six.
I have this version:

$ dnf install /usr/bin/reporter-bugzilla
Updating and loading repositories:
Repositories loaded.
Package "libreport-plugin-bugzilla-2.17.15-5.fc42.aarch64" is already installed.

Nothing to do.

Please provide a python stack trace of the error.
Also why are you now running via an explicit python3?

I running nothing explicitly, I take information from abrt gui.

I can extract from report :

exceptions.py:3:<module>:ModuleNotFoundError: No module named 'urllib3.packages.six.moves'

Traceback (most recent call last):
  File "/usr/bin/reporter-bugzilla", line 34, in <module>
    from reportclient.internal.bz_connection import BZConnection
  File "/usr/lib64/python3.13/site-packages/reportclient/internal/bz_connection.py", line 29, in <module>
    import requests
  File "/usr/local/lib/python3.13/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/usr/local/lib/python3.13/site-packages/urllib3/__init__.py", line 11, in <module>
    from . import exceptions
  File "/usr/local/lib/python3.13/site-packages/urllib3/exceptions.py", line 3, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
Local variables in innermost frame:
__name__: 'urllib3.exceptions'
__doc__: None
__package__: 'urllib3'
__loader__: <_frozen_importlib_external.SourceFileLoader object at 0x7f1889c8d550>
__spec__: ModuleSpec(name='urllib3.exceptions', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f1889c8d550>, origin='/usr/local/lib/python3.13/site-packages/urllib3/exceptions.py')
__file__: '/usr/local/lib/python3.13/site-packages/urllib3/exceptions.py'
__cached__: '/usr/local/lib/python3.13/site-packages/urllib3/__pycache__/exceptions.cpython-313.pyc'
__builtins__: {'__name__': 'builtins', '__doc__': "Built-in functions, types, exceptions, and other objects.\n\nThis module provides direct access to all 'built-in'\nidentifiers of Python; for example, builtins.len is\nthe full name for the built-in function len().\n\nThis module is not normally accessed explicitly by most\napplications, but can be useful in modules that provide\nobjects with the same name as a built-in value, but in\nwhich the built-in of that name is also needed.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'aiter': <built-in function aiter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'anext': <built-in function anext>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'BaseExceptionGroup': <class 'BaseExceptionGroup'>, 'Exception': <class 'Exception'>, 'GeneratorExit': <class 'GeneratorExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'SystemExit': <class 'SystemExit'>, 'ArithmeticError': <class 'ArithmeticError'>, 'AssertionError': <class 'AssertionError'>, 'AttributeError': <class 'AttributeError'>, 'BufferError': <class 'BufferError'>, 'EOFError': <class 'EOFError'>, 'ImportError': <class 'ImportError'>, 'LookupError': <class 'LookupError'>, 'MemoryError': <class 'MemoryError'>, 'NameError': <class 'NameError'>, 'OSError': <class 'OSError'>, 'ReferenceError': <class 'ReferenceError'>, 'RuntimeError': <class 'RuntimeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'SyntaxError': <class 'SyntaxError'>, 'SystemError': <class 'SystemError'>, 'TypeError': <class 'TypeError'>, 'ValueError': <class 'ValueError'>, 'Warning': <class 'Warning'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'BytesWarning': <class 'BytesWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'EncodingWarning': <class 'EncodingWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'UserWarning': <class 'UserWarning'>, 'BlockingIOError': <class 'BlockingIOError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionError': <class 'ConnectionError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'InterruptedError': <class 'InterruptedError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'IndentationError': <class 'IndentationError'>, '_IncompleteInputError': <class '_IncompleteInputError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'PythonFinalizationError': <class 'PythonFinalizationError'>, 'RecursionError': <class 'RecursionError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'UnicodeError': <class 'UnicodeError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'TabError': <class 'TabError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'ExceptionGroup': <class 'ExceptionGroup'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2024 Python Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'credits':     Thanks to CWI, CNRI, BeOpen, Zope Corporation, the Python Software
    Foundation, and a cast of thousands for supporting Python
    development.  See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}
absolute_import: _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 262144)

executable : /usr/bin/reporter-bugzilla
package : libreport-plugin-bugzilla-2.17.15-5.fc42
component : libreport

It’s unusual that it’s taking the package from /usr/local/lib rather than /usr/lib.

Do you have a version of urllib3 that you installed via pip rather than as a Fedora package?

See for example: https://stackoverflow.com/questions/54234344/the-reason-cause-different-location-of-python-packages

1 Like

I must have tried installing a Python program not long ago, but I can’t remember which one. Even though I tried to do it in a virtual environment, I’m not familiar with it, and I must have done something wrong.
I think the best thing to do would be to clean up what was installed in /usr/local regarding Python.
What would be a good way to do this?

As spotted by @pg-tips

You will have to get rid of packages you installed into /usr/local if you want Fedora shipped tools to work.

The best way to handle installing packages from PyPI is in a venv.

1 Like

Just removing /usr/local/lib/python3.13 should do it.

To be safe, you could move it somewhere in your homedir in case you want to revert. (But ideally you won’t, I think all of us on this thread agree that packages should always be installed into a venv, a Conda env etc).

mkdir ~/pythonbak
sudo mv /usr/local/lib/python3.13 ~/pythonbak

Subsequently, you might want to find out what is setting your PYTHONPATH environment variable and thereby injecting this /usr/local/... path into Python’s sys.path. However that isn’t urgent, Python will just ignore the now non-existent directory.

Thank you @pg-tips and @barryascott .

Deleting the files fixes the problem.

1 Like