ModuleNotFoundError: No module named 'pkg_resources' error after upgrading to Devbox v0.0.9

This issue has been tracked since 2022-10-06.

Description

After Devbox automatically upgraded itself to v0.0.9, my Devbox environment broke. This was not happening in Devbox v0.0.7.

When running python -m pipenv inside the Devbox instance, the following error is shown:

Traceback (most recent call last):
  File "/nix/store/rs23kn5r3qm96cq26b6bzy2w7rs5r39d-python3-3.10.5/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/nix/store/rs23kn5r3qm96cq26b6bzy2w7rs5r39d-python3-3.10.5/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/nix/store/rs23kn5r3qm96cq26b6bzy2w7rs5r39d-python3-3.10.5/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/Users//*****/.local/lib/python3.10/site-packages/pipenv/__init__.py", line 58, in <module>
    from .cli import cli
  File "/Users//*****/.local/lib/python3.10/site-packages/pipenv/cli/__init__.py", line 1, in <module>
    from .command import cli  # noqa
  File "/Users//*****/.local/lib/python3.10/site-packages/pipenv/cli/command.py", line 7, in <module>
    from pipenv.cli.options import (
  File "/Users//*****/.local/lib/python3.10/site-packages/pipenv/cli/options.py", line 3, in <module>
    from pipenv.project import Project
  File "/Users//*****/.local/lib/python3.10/site-packages/pipenv/project.py", line 23, in <module>
    from pipenv.environment import Environment
  File "/Users/*****/.local/lib/python3.10/site-packages/pipenv/environment.py", line 14, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

Running pipenv alone does not cause the error, only python -m pipenv does now.

My devbox.json:

{
  "packages": [
    "python310",
    "pipenv"
  ]
}

How to reproduce

  1. Use Devbox v0.0.9 (I suspect v0.0.8 is the version, where this regression started to occur)
  2. Use the devbox.json shown above
  3. Run python -m pipenv inside the Devbox shell

I hope there will be a way to fix the version of Devbox to make these kinds of regression bugs

savil wrote this answer on 2022-10-12

@alehuo thanks for the report. We'll look into it early tomorrow (I was just about to sleep).

For the time being, running with DEVBOX_USE_VERSION=0.0.7 devbox shell may help unblock you. Let us know if that works?

alehuo wrote this answer on 2022-10-12

@savil Running DEVBOX_USE_VERSION=0.0.7 devbox shell helped, and I'm again up and running.

savil wrote this answer on 2022-10-12

This should be fixed in version 0.0.10, which was just released.

alehuo wrote this answer on 2022-10-12

Confirmed to be working again in version 0.0.10. Thank you for the fast fix!

More Details About Repo
Owner Name jetpack-io
Repo Name devbox
Full Name jetpack-io/devbox
Language Go
Created Date 2022-08-18
Updated Date 2023-03-31
Star Count 4960
Watcher Count 19
Fork Count 68
Issue Count 42

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date