Running "pipenv shell" fails with AttributeError

Bug #1970106 reported by George Ouzounoudis
108
This bug affects 21 people
Affects Status Importance Assigned to Milestone
pipenv (Debian)
Fix Released
Unknown
pipenv (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I recently upgraded from Ubuntu 20.04 to 22.04

Running pipenv shell to create a virtual env results in the following and no environment is created.

Traceback (most recent call last):
  File "/usr/bin/pipenv", line 33, in <module>
    sys.exit(load_entry_point('pipenv==11.9.0', 'console_scripts', 'pipenv')())
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pipenv/cli.py", line 548, in shell
    from .import core
  File "/usr/lib/python3/dist-packages/pipenv/core.py", line 21, in <module>
    import requests
  File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/__init__.py", line 65, in <module>
    from . import utils
  File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/utils.py", line 27, in <module>
    from .cookies import RequestsCookieJar, cookiejar_from_dict
  File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/cookies.py", line 172, in <module>
    class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'

Further info:

lsb_release -rd:
Description: Ubuntu 22.04 LTS
Release: 22.04

apt-cache policy pipenv:
pipenv:
  Installed: 11.9.0-1.1
  Candidate: 11.9.0-1.1
  Version table:
 *** 11.9.0-1.1 500
        500 http://gr.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: pipenv 11.9.0-1.1
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
Uname: Linux 5.15.0-25-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Sun Apr 24 16:25:34 2022
InstallationDate: Installed on 2021-10-16 (189 days ago)
InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819)
PackageArchitecture: all
SourcePackage: pipenv
UpgradeStatus: Upgraded to jammy on 2022-04-23 (0 days ago)

Revision history for this message
George Ouzounoudis (gouzou) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pipenv (Ubuntu):
status: New → Confirmed
Revision history for this message
Joshua Kugler (jkugler) wrote :

This is discussed here: https://github.com/pypa/pipenv/issues/5088

This error occurs with the system package:
```
vagrant@vagrant:~$ which pipenv
/usr/bin/pipenv
vagrant@vagrant:~mojo_coordinator$ dpkg -S /usr/bin/pipenv
pipenv: /usr/bin/pipenv
vagrant@vagrant:~$ dpkg -l pipenv
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-===============================================
ii pipenv 11.9.0-1.1 all Python's officially recommended packaging tool
```

The pipenv version installed in the system packages is from March 21, 2018. That seems like a pretty bad failure to keep the package up to do, through multiple releases.

Changed in pipenv (Debian):
status: Unknown → New
Revision history for this message
Michael De La Rue (mikedlr) wrote :

The workaround for this is

apt remove pipenv
sudo pip install pipenv

which will give a warning because it's a messy thing to do. Pipenv needs to be updated.

The relevant Debian bug for this is

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012124

which it would be great if someone with contacts in Debian fixed.

Changed in pipenv (Debian):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pipenv - 2022.10.25+ds2-1

---------------
pipenv (2022.10.25+ds2-1) unstable; urgency=medium

  [ Ileana Dumitrescu ]
  * New upstream release (Closes: #945139) (LP: #1943582)
    Builds with python3.10 (Closes: #1012124) (LP: #1970106)
    Fixes pipenv check issue (Closes: #941447)
  * Remove patches (no longer needed)
  * d/control: Bump standards version to 4.6.1
               Add Rules-Requires-Root line
               Remove unnecessary comments
               Add myself as an uploader
  * d/copyright: Exclude get-pipenv.py from tarball (Closes: #1019714)
                 Exclude prebuilt windows binaries from tarball
                 Update licensing
                 Update debian copyright year to 2022
  * d/pipenv.docs: Fix README.rst location
  * d/rules: Remove unnecessary comments
             Remove vendor license and readme files during dh_auto_install
  * d/source/lintian-overrides: Override for false positive source-is-missing
  * d/watch: Remove unnecessary comments
             Remove <project> string and debian uupdate
             Add repack opts

  [ Bastian Germann ]
  * d/control: No longer endorse the package as official (Closes: #958292)

  [ Jeroen Ploemen ]
  * Control: bump compat level to 13 (from 10).
  * Rules: set buildsystem to pybuild.

 -- Ileana Dumitrescu <email address hidden> Mon, 31 Oct 2022 16:36:38 +0000

Changed in pipenv (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Xaocon (xaocon) wrote :

Jammy will still be getting support in 2032. Is this fix likely to be backported?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.