Skip to content

ModuleNotFoundError: No module named 'urllib3.packages.six.moves' with Python 3.12 #785

Closed
@nodet

Description

@nodet

Summary

LinkChecker doesn't work with Python 3.12.
Reproduces using v10.4.0 from git.

Steps to reproduce

git checkout v10.4.0
python3.12 -m venv --prompt "linkchecker" venv
source venv/bin/activate
pip install hatchling hatch-vcs -r requirements-min.txt
hatchling build --hooks-only
python --version
python -m linkcheck

Actual result

This ends with:

[...]
Python 3.12.1
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/xavier.nodet/src/linkchecker/linkcheck/__main__.py", line 1, in <module>
    from .command.linkchecker import linkchecker
  File "/Users/xavier.nodet/src/linkchecker/linkcheck/command/linkchecker.py", line 28, in <module>
    from .arg_parser import ArgParser
  File "/Users/xavier.nodet/src/linkchecker/linkcheck/command/arg_parser.py", line 22, in <module>
    from .. import checker, logconf, logger, COMMAND_NAME
  File "/Users/xavier.nodet/src/linkchecker/linkcheck/checker/__init__.py", line 202, in <module>
    from . import (  # noqa: E402
  File "/Users/xavier.nodet/src/linkchecker/linkcheck/checker/fileurl.py", line 26, in <module>
    from . import urlbase, get_index_html
  File "/Users/xavier.nodet/src/linkchecker/linkcheck/checker/urlbase.py", line 42, in <module>
    from .const import (
  File "/Users/xavier.nodet/src/linkchecker/linkcheck/checker/const.py", line 21, in <module>
    import requests
  File "/Users/xavier.nodet/src/linkchecker/venv/lib/python3.12/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/Users/xavier.nodet/src/linkchecker/venv/lib/python3.12/site-packages/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/Users/xavier.nodet/src/linkchecker/venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 11, in <module>
    from .exceptions import (
  File "/Users/xavier.nodet/src/linkchecker/venv/lib/python3.12/site-packages/urllib3/exceptions.py", line 2, in <module>
    from .packages.six.moves.http_client import (
ModuleNotFoundError: No module named 'urllib3.packages.six.moves'

Expected result

Using Python 3.11.6, I get the output I expect:

Python 3.11.6
INFO linkcheck.cmdline 2024-01-12 13:57:06,986 MainThread Checking intern URLs only; use --check-extern to check extern URLs.
WARNING linkcheck.cmdline 2024-01-12 13:57:06,989 MainThread no files or URLs given
LinkChecker 10.4.0
Copyright (C) 2000-2016 Bastian Kleineidam, 2010-2023 LinkChecker Authors
LinkChecker comes with ABSOLUTELY NO WARRANTY!
This is free software, and you are welcome to redistribute it under
certain conditions. Look at the file `COPYING' within this distribution.
Read the documentation at https://linkchecker.github.io/linkchecker/
Write comments and bugs to https://github.com/linkchecker/linkchecker/issues

Start checking at 2024-01-12 13:57:06+002

Statistics:
Downloaded: 0B.
No statistics available since no URLs were checked.

That's it. 0 links in 0 URLs checked. 0 warnings found. 0 errors found.
Stopped checking at 2024-01-12 13:57:06+002 (0.00 seconds)

Environment

  • Operating system: Darwin xavier-nodet-macbookpro.home 22.6.0 Darwin Kernel Version 22.6.0: Tue Nov 7 21:40:08 PST 2023; root:xnu-8796.141.3.702.9~2/RELEASE_ARM64_T6000 arm64
  • Linkchecker version: v10.4.0 tag from git
  • Python version: 3.12.1
  • Install method: from git

Other notes

Seems the same issue as Datalux/Osintgram#943.

Activity

nodet

nodet commented on Jan 12, 2024

@nodet
ContributorAuthor

If using pip install -r requirements.txt instead of pip install -r requirements-min.txt, things work fine with Python 3.12 as well.

added a commit that references this issue on Jan 12, 2024

[linkchecker#785] Update requests to 2.25, required for Python 3.12

nodet

nodet commented on Jan 12, 2024

@nodet
ContributorAuthor

I created #786 to fix this issue.

cjmayo

cjmayo commented on Jan 14, 2024

@cjmayo
Contributor

requirements-min.txt is for CI testing only.

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      ModuleNotFoundError: No module named 'urllib3.packages.six.moves' with Python 3.12 · Issue #785 · linkchecker/linkchecker