question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ModuleNotFoundError: No module named 'pipenv.vendor.packaging'

See original GitHub issue

Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.

Check the diagnose documentation for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.

Make sure to mention your debugging experience if the documented solution failed.

Issue description

pipenv uninstall --all-dev does not work. It tells me ModuleNotFoundError: No module named 'pipenv.vendor.packaging'

Expected result

pipenv uninstall --all-dev works as expected

Describe what you expected.

Actual result

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).

Please follow these steps to reproduce:

  1. create a new folder
  2. cd into new folder
  3. pipenv install
  4. pipenv uninstall --all-dev
  5. watch error

it should not give an error.

[kus@asus-vivobook scripts]$ cd ~/src/personal/ [kus@asus-vivobook personal]$ mkdir -p myrequest [kus@asus-vivobook personal]$ cd myrequest/ [kus@asus-vivobook myrequest]$ ls -a . … [kus@asus-vivobook myrequest]$ pipenv install Creating a virtualenv for this project… Pipfile: /home/kus/src/personal/myrequest/Pipfile Using /usr/bin/python3 (3.7.2) to create virtualenv… ⠼ Creating virtual environment…Already using interpreter /usr/bin/python3 Using base prefix ‘/usr’ New python executable in /home/kus/.local/share/virtualenvs/myrequest-fayK9fOV/bin/python3 Also creating executable in /home/kus/.local/share/virtualenvs/myrequest-fayK9fOV/bin/python Installing setuptools, pip, wheel…done.

✔ Successfully created virtual environment! Virtualenv location: /home/kus/.local/share/virtualenvs/myrequest-fayK9fOV Creating a Pipfile for this project… Pipfile.lock not found, creating… Locking [dev-packages] dependencies… Locking [packages] dependencies… Updated Pipfile.lock (a65489)! Installing dependencies from Pipfile.lock (a65489)… 🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00 To activate this project’s virtualenv, run pipenv shell. Alternatively, run a command inside the virtualenv with pipenv run. [kus@asus-vivobook myrequest]$ pipenv uninstall --all-dev Traceback (most recent call last): File “/usr/bin/pipenv”, line 11, in <module> load_entry_point(‘pipenv==2018.11.26’, ‘console_scripts’, ‘pipenv’)() File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 764, in call return self.main(*args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 717, in main rv = self.invoke(ctx) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 555, in invoke return callback(*args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py”, line 64, in new_func return ctx.invoke(f, obj, *args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 555, in invoke return callback(*args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py”, line 17, in new_func return f(get_current_context(), *args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/cli/command.py”, line 301, in uninstall ctx=ctx File “/usr/lib/python3.7/site-packages/pipenv/core.py”, line 2012, in do_uninstall from .vendor.packaging.utils import canonicalize_name ModuleNotFoundError: No module named ‘pipenv.vendor.packaging’


Please run $ pipenv --support, and paste the results here. Don’t put backticks (`) around it! The output already contains Markdown formatting.

If you’re on macOS, run the following:

$ pipenv --support | pbcopy

If you’re on Windows, run the following:

> pipenv --support | clip

If you’re on Linux, run the following:

$ pipenv --support | xclip

$ pipenv --support

$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: '/usr/lib/python3.7/site-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.7.2: /usr/bin/python3.7m
  • 3.7.2: /usr/bin/python3
  • 2.7.15: /usr/bin/python

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.2',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.19.15-300.fc29.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Mon Jan 14 16:32:35 UTC 2019',
 'python_full_version': '3.7.2',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

  • NVM_DIR
  • LS_COLORS
  • XDG_MENU_PREFIX
  • MODULES_RUN_QUARANTINE
  • LANG
  • GDM_LANG
  • HISTCONTROL
  • DISPLAY
  • HOSTNAME
  • OLDPWD
  • COLORTERM
  • NVM_CD_FLAGS
  • USERNAME
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • XDG_SESSION_ID
  • MODULES_CMD
  • USER
  • ENV
  • DESKTOP_SESSION
  • GNOME_TERMINAL_SCREEN
  • PWD
  • HOME
  • SSH_AGENT_PID
  • XDG_SESSION_TYPE
  • BASH_ENV
  • XDG_DATA_DIRS
  • XDG_SESSION_DESKTOP
  • GJS_DEBUG_OUTPUT
  • LOADEDMODULES
  • MAIL
  • WINDOWPATH
  • TERM
  • SHELL
  • VTE_VERSION
  • QT_IM_MODULE
  • XMODIFIERS
  • NVM_BIN
  • XDG_CURRENT_DESKTOP
  • GNOME_TERMINAL_SERVICE
  • SHLVL
  • XDG_SEAT
  • MODULEPATH
  • GDMSESSION
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • MODULEPATH_modshare
  • PATH
  • MODULESHOME
  • HISTSIZE
  • GJS_DEBUG_TOPICS
  • SESSION_MANAGER
  • LESSOPEN
  • BASH_FUNC_module%%
  • BASH_FUNC__module_raw%%
  • BASH_FUNC_switchml%%
  • BASH_FUNC_scl%%
  • _
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/kus/bin/flutter/bin:/home/kus/.symfony/bin:/home/kus/.local/bin:/home/kus/bin:/home/kus/bin/flutter/bin:/home/kus/.symfony/bin:/home/kus/.local/bin:/home/kus/bin:/home/kus/.cargo/bin:/home/kus/.nvm/versions/node/v11.7.0/bin:/home/kus/bin/flutter/bin:/home/kus/.symfony/bin:/home/kus/.local/bin:/home/kus/bin:/usr/share/Modules/bin:/home/kus/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/kus/.composer/vendor/bin:/home/kus/.dotnet/tools
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/kus/src/personal/scripts

Contents of Pipfile (‘/home/kus/src/personal/scripts/Pipfile’):

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
python-dotenv = "*"

[requires]
python_version = "3.7"

Contents of Pipfile.lock (‘/home/kus/src/personal/scripts/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "460c68ee01296bbb390236c2df5047ef06ac87f6ba3a4dde6adbdb8418313b84"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "python-dotenv": {
            "hashes": [
                "sha256:a84569d0e00d178bc5b957f7ff208bf49287cbf61857c31c258c4a91f571527b",
                "sha256:c9b1ddd3cdbe75c7d462cb84674d87130f4b948f090f02c7d7144779afb99ae0"
            ],
            "index": "pypi",
            "version": "==0.10.1"
        }
    },
    "develop": {}
}

[kus@asus-vivobook scripts]$ pipenv run python pinpoint.py Creating a virtualenv for this project… Pipfile: /home/kus/src/personal/scripts/Pipfile Using /usr/bin/python3.7m (3.7.2) to create virtualenv… ⠧ Creating virtual environment…Using base prefix ‘/usr’ New python executable in /home/kus/.local/share/virtualenvs/scripts-Vch89g9b/bin/python3.7m Also creating executable in /home/kus/.local/share/virtualenvs/scripts-Vch89g9b/bin/python Installing setuptools, pip, wheel…done. Running virtualenv with interpreter /usr/bin/python3.7m

✔ Successfully created virtual environment! Virtualenv location: /home/kus/.local/share/virtualenvs/scripts-Vch89g9b /home/kus/.local/share/virtualenvs/scripts-Vch89g9b/bin/python: can’t open file ‘pinpoint.py’: [Errno 2] No such file or directory [kus@asus-vivobook scripts]$ pipenv uninstall --all-dev Traceback (most recent call last): File “/usr/bin/pipenv”, line 11, in <module> load_entry_point(‘pipenv==2018.11.26’, ‘console_scripts’, ‘pipenv’)() File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 764, in call return self.main(*args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 717, in main rv = self.invoke(ctx) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 555, in invoke return callback(*args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py”, line 64, in new_func return ctx.invoke(f, obj, *args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/core.py”, line 555, in invoke return callback(*args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py”, line 17, in new_func return f(get_current_context(), *args, **kwargs) File “/usr/lib/python3.7/site-packages/pipenv/cli/command.py”, line 301, in uninstall ctx=ctx File “/usr/lib/python3.7/site-packages/pipenv/core.py”, line 2012, in do_uninstall from .vendor.packaging.utils import canonicalize_name ModuleNotFoundError: No module named ‘pipenv.vendor.packaging’

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
hroncokcommented, Jan 22, 2019

I have a Fedora fix ready with a grep check for this to not happen again.

1reaction
hroncokcommented, Jan 22, 2019

Sure thing.

@9034725985 please use https://bugz.fedoraproject.org/pipenv for Fedora bugs next time. I’ll gladly forward the report to upstream if i think it’s an upstream bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv `ModuleNotFoundError: No module named 'pip ...
My packages only work in 3.9 and that's what the environment is set to. 3.10 is system Python. The way I solved it...
Read more >
python - ImportError: No module named 'pip._vendor.packaging'
I am using Ubuntu 21.10. I get this error: (foobar_addressbook) guettli@p15:~/foobar/projects/foobar_addressbook$ tox -e py35-django18 py35- ...
Read more >
[Fixed] ModuleNotFoundError: No module named 'pip' - Finxter
Quick Fix: Python raises the ImportError: No module named 'pip' when it cannot find the library pip . The most frequent source of...
Read more >
pipenv Documentation - Read the Docs
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the. Python...
Read more >
No module named 'numpy'" windowsOS/pipenv shell - Python
Try python -m site for a detail on where the current python interpreter is looking for modules and libraries. Then try within your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found