Skip to content
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

ModuleNotFoundError for http package when using pip after setup #1029

Open
2 of 5 tasks
silv-io opened this issue Feb 6, 2025 · 1 comment
Open
2 of 5 tasks

ModuleNotFoundError for http package when using pip after setup #1029

silv-io opened this issue Feb 6, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@silv-io
Copy link

silv-io commented Feb 6, 2025

Description:
When using pip to, e.g., install setuptools after running the action, we sometimes (but not always) get a ModuleNotFoundError: No module named 'http' error.
This doesn't happen always, and a re-run of the GitHub action usually resolves this error.
The error happens inside urllib, and is also filed there: urllib3/urllib3#3558 where they referred to the action.

Action version:
v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted (buildjet-2vcpu-ubuntu-2204)

Tools version:

Python 3.11

Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install docker helper dependencies
        run: pip install --upgrade setuptools setuptools_scm

Expected behavior:

This should always work without issue.

Actual behavior:

Sometimes (but not always) we get the following error:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.9/x64/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module>
    from pip._internal.build_env import get_runnable_pip
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_internal/build_env.py", line 19, in <module>
    from pip._internal.cli.spinners import open_spinner
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_internal/cli/spinners.py", line 9, in <module>
    from pip._internal.utils.logging import get_indentation
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_internal/utils/logging.py", line 29, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_internal/utils/misc.py", line 43, in <module>
    from pip._internal.exceptions import CommandError, ExternallyManagedEnvironment
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_internal/exceptions.py", line 18, in <module>
    from pip._vendor.requests.models import Request, Response
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_vendor/requests/__init__.py", line 43, in <module>
    from pip._vendor import urllib3
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_vendor/urllib3/__init__.py", line 11, in <module>
    from . import exceptions
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_vendor/urllib3/exceptions.py", line 3, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_vendor/urllib3/packages/six.py", line 234, in create_module
    return self.load_module(spec.name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_vendor/urllib3/packages/six.py", line 209, in load_module
    mod = mod._resolve()
          ^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_vendor/urllib3/packages/six.py", line 118, in _resolve
    return _import_module(self.mod)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pip/_vendor/urllib3/packages/six.py", line 87, in _import_module
    __import__(name)
ModuleNotFoundError: No module named 'http'
@silv-io silv-io added bug Something isn't working needs triage labels Feb 6, 2025
@gowridurgad
Copy link
Contributor

Hi @silv-io ,
Thank you for reporting this issue. We will investigate it and get back to you as soon as we have some feedback.

@priya-kinthali priya-kinthali self-assigned this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants