Skip to content

Cannot import six.moves.urllib with bpython #874

Closed

Description

@michel-slm

Fedora bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1782782

Tried on Fedora 33 with both bpython installed from RPM and in a venv (on Python 3.9.0). The same operations work fine using /usr/bin/python3 and IPython.

~ 
❯ bpython
bpython version unknown on top of Python 3.9.0 /usr/bin/python3
>>> from fedora import client
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    from fedora import client
  File "/usr/lib/python3.9/site-packages/fedora/client/__init__.py", line 157, in <module>
    from fedora.client.proxyclient import ProxyClient
  File "/usr/lib/python3.9/site-packages/fedora/client/proxyclient.py", line 39, in <module>
    from six.moves.urllib.parse import quote, urljoin, urlparse
ModuleNotFoundError: No module named 'six.moves.urllib'
>>> import six
>>> from six.moves import urllib
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    from six.moves import urllib
  File "/usr/lib/python3.9/site-packages/six.py", line 92, in __get__
    result = self._resolve()
  File "/usr/lib/python3.9/site-packages/six.py", line 115, in _resolve
    return _import_module(self.mod)
  File "/usr/lib/python3.9/site-packages/six.py", line 82, in _import_module
    __import__(name)
ModuleNotFoundError: No module named 'six.moves.urllib'
>>> from bodhi import client
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    from bodhi import client
  File "/usr/lib/python3.9/site-packages/bodhi/client/__init__.py", line 30, in <module>
    from fedora.client import AuthError, openidproxyclient
  File "/usr/lib/python3.9/site-packages/fedora/client/__init__.py", line 157, in <module>
    from fedora.client.proxyclient import ProxyClient
  File "/usr/lib/python3.9/site-packages/fedora/client/proxyclient.py", line 39, in <module>
    from six.moves.urllib.parse import quote, urljoin, urlparse
ModuleNotFoundError: No module named 'six.moves.urllib'
>>> 

Activity

  1. sebastinas commented on Jan 9, 2021

    @sebastinas
    Contributor

    I'm unable to reproduce the issue with bpython 0.20, current git master and six versions 1.11 and 1.15. Could you please provide more details on the versions you tried?

  2. michel-slm commented on Jan 14, 2021

    @michel-slm
    Author

    Sorry for the delay! Fedora is on bpython 0.20: https://bodhi.fedoraproject.org/updates/FEDORA-2020-a48d4fa5f4 is the version I tried and this is the corresponding build definition: https://src.fedoraproject.org/rpms/bpython/tree/0969da351f74b0a60676afda07e7a967d926384a

    I can try uninstalling bpython completely, then trying installing specifically version 0.20 in a virtual environment; if it reproduces again could it be something unexpected about Fedora's Python installation?

  3. sebastinas commented on Jan 16, 2021

    @sebastinas
    Contributor

    The issue is bpython.curtsiesfrontend.repl.ImportFinder when watchdog is installed.

  4. added this to the release-0.21 milestone on Jan 16, 2021
  5. added a commit that references this issue on Feb 25, 2026
    275a6e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions