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

AttributeError: module 'pkgutil' has no attribute 'ImpImporter' #1882

Open
mar10 opened this issue Oct 20, 2024 · 0 comments
Open

AttributeError: module 'pkgutil' has no attribute 'ImpImporter' #1882

mar10 opened this issue Oct 20, 2024 · 0 comments
Labels

Comments

@mar10
Copy link

mar10 commented Oct 20, 2024

Bug description

I submitted this link to mybinder.org:
https://github.com/mar10/nutree/blob/main/docs/jupyter/walkthrough.ipynb

image

And get this error message.

Step 43/53 : USER ${NB_USER}
 ---> Running in 22ecf3c829d5
 ---> Removed intermediate container 22ecf3c829d5
 ---> 399144cb372f
Step 44/53 : RUN (cd . &&                     PATH="${KERNEL_PYTHON_PREFIX}/bin:$PATH"                         pipenv install --ignore-pipfile --system --dev &&                         pipenv --clear                 )
 ---> Running in 86139a31e456
Traceback (most recent call last):
  File "/srv/conda/envs/notebook/bin/pipenv", line 5, in <module>
    from pipenv import cli
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/__init__.py", line 57, in <module>
    from .cli import cli
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/cli/__init__.py", line 1, in <module>
    from .command import cli    # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/cli/command.py", line 7, in <module>
    from pipenv.cli.options import (
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/cli/options.py", line 3, in <module>
    from pipenv.project import Project
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/project.py", line 32, in <module>
    from pipenv.vendor.requirementslib.models.utils import (
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/requirementslib/__init__.py", line 7, in <module>
    from .models.lockfile import Lockfile
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 14, in <module>
    from ..utils import is_editable, is_vcs, merge_items
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/requirementslib/utils.py", line 11, in <module>
    import pip_shims.shims
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/__init__.py", line 26, in <module>
    from . import shims
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/shims.py", line 12, in <module>
    from .models import (
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/models.py", line 775, in <module>
    Command.add_mixin(SessionCommandMixin)
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/models.py", line 689, in add_mixin
    mixin = mixin.shim()
            ^^^^^^^^^^^^
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/models.py", line 737, in shim
    result = self.traverse(top_path)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/models.py", line 729, in traverse
    result = shim.shim()
             ^^^^^^^^^^^
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/models.py", line 575, in shim
    imported = self._import()
               ^^^^^^^^^^^^^^
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/models.py", line 600, in _import
    result = self._import_module(self.calculated_module_path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/vendor/pip_shims/models.py", line 352, in _import_module
    imported = importlib.import_module(module)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/conda/envs/notebook/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/patched/notpip/_internal/cli/req_command.py", line 15, in <module>
    from pipenv.patched.notpip._internal.cache import WheelCache
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/patched/notpip/_internal/cache.py", line 13, in <module>
    from pipenv.patched.notpip._internal.exceptions import InvalidWheelFilename
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/patched/notpip/_internal/exceptions.py", line 7, in <module>
    from pipenv.patched.notpip._vendor.pkg_resources import Distribution
  File "/srv/conda/envs/notebook/lib/python3.12/site-packages/pipenv/patched/notpip/_vendor/pkg_resources/__init__.py", line 2164, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
 ---> Removed intermediate container 86139a31e456
The command '/bin/sh -c (cd . &&                     PATH="${KERNEL_PYTHON_PREFIX}/bin:$PATH"                         pipenv install --ignore-pipfile --system --dev &&                         pipenv --clear                 )' returned a non-zero code: 1

Is this a known problem or is it possible, that an old pip is used?
According to this StackOverflow answer it may helot update pip.

How to reproduce

  1. Submit the project listed above

Expected behaviour

Launch a valid Jupyter environment for the submitted notebook.

Actual behaviour

Error message during build process.

Your personal set up

  • OS:
  • Version(s):
Full environment
# paste output of `pip freeze` or `conda list` here
Configuration
# jupyterhub_config.py
Logs
@mar10 mar10 added the bug label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant